Using Fonts

BlitzPlus Forums/BlitzPlus Programming/Using Fonts

In Blitz, a font is loaded using the LoadFont command.

But if you want to use a font that is not probably present on the target pc, then bare in mind that:

- the font has two names: one, is the file name, another is the font name.

Which is the file name, is clear. The font name, instead, is written inside the font file, and may be the same of the file name (without extention), but may be also not.

So, to use a font, make sure that you:

- provide the font with the file name being the same of the font name.
- loadfont ("font_name.ttf" (or .fon)) in blitz

So, for example, if you want to use thefont.ttf in your game, and need to distribute it, then first open the font file, and look which is the real name of the font.
If the name is the same as the file name, then no prob.
If the name is different, then rename the file name with that name.

Put the new font file in your game directory, refer to it with loadfont command - Done.

Hope this helps,
Sergio.