• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM string_height returns wrong value?

TheBroman90

Member
I'm making a colission mask for my menu buttons, based on their string size.

Code:
draw_set_font(font);
var width = string_width(text);
var height = string_height(text);
When I'm using Arial the colission mask works, but when I use the pixel font bellow the height is wrong.
Why is it not working?

 
Last edited:

TheouAegis

Member
Draw in the normal draw event and check the box size.

But kinda looks like the font's properties were incorrectly set in the font itself.
 

TheouAegis

Member
Did you get the font from a website? If so, what font and site?

There are two lines in a font's data, one near the top and one near the bottom. I think string_get_height() just goes off those two lines for most fonts.
 

TheBroman90

Member
Probably font doesn't have symbols like "%", "&" so GMS add some excess pixels in your font. Try to add these symbols in this font or edit the font range.
I edited the font range to only include letters and digits, but there's still extra space above.
 
Top