• 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!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Windows How to change the vertical offset of fonts loaded in GMS2

vdweller

Member
Hi all,

My project was initially built in GameMaker Studio 1.4. As such, fonts were loaded and drawn in positions according to what looked right in GMS1.4.

When I upgraded to version 2, there was the option to keep these fonts untouched (keep them as "legacy" fonts) in order to preserve them exactly as they looked like so far.

However when the need arises to add more characters to a font, you can't do that anymore, and the font must be reloaded. My issue is that when I do that, the vertical offset of the font is changed by 1 pixel, which is pretty noticeable in a pixel-y game:

1606126363321.png

1606126374902.png

In the second image you can see that the font is drawn 1 pixel more to the top. Ignore the spacing difference between fonts at for now, I had edited the font to have more space in Font Forge.

My question is, does anyone know what properties can I alter in the font itself via a program like Font Forge in order to make it draw correctly? In the generated .yy file, if I alter the "ascenderOffset" property, the problem can be fixed but this is a sloppy solution because every time the font changes, it gets back to its default value. Another solution is to wrap the draw_text function in another function that adds a +1 y offset but again this will make things slower.

I am literally willing to pay anyone who can accurately modify the fonts to display like they originally did. Please anyone, let me know if you know of a solution, either from within GM or from a font editing program.

IDE version: 2.2.5.481
Runtime version: 2.2.5.378

Thanks,

Emilios
 
Top