Game Font Problem [need help]

Hey guys,

I have a problem with my font in my game. basically the font i have in the game is a font in which i installed on my computer. It shows perfectly on my PC but when one of my friends plays the games on his computer its not working properly, It’s like its not the right font. Does anyone know how i could fix this ? thanks

  • Glenn

What library are you working with? LibGDX? Java2D? You’ll need to include the font in the resources folder of your game and then reference it in the code, but this depends on what library you’re using. LibGDX allows you to load outside fonts by simply creating a new instance of Font and passing in the font file, I actually dont know how to do it in Java2D, but a quick Google search could fix that!

If you can you should avoid dependency on TTF\OTF files.

Most games use a font sprite sheet. There are two reasons to do this:

  • Getting a license to distribute the font rendered into a sprite-sheet is usually a lot easier to acquire. Distributing the TTF can become very expensive and can create a lot of licensing head aches.

  • Drawing font from a sprite-sheet is much more optimal and memory efficient for games. You don’t need a lot of the TTF implementation for games (which typically have a very primitive UI subsystem anways…)

Some games will distribute with the TTFs so that they can re-generate (and cache) fonts into a sprite sheet when the users resolution changes etc.

Thank you for the advice.