Intro: understanding fonts and text

Fonts are defined in a separate font-file, located under the
VgaGames-install-directory /usr/share/vgagames
or in the local subdirectory "share/" of your game,
where also are located the colormap-files.
They are loaded and used by vg_bitmap_createfromtext() and vg_draw_text().

Name of a font-file

Then name of a font-file must be:
e.g. 8x8.font:       width of a character is 8 pixels, height is 8 pixels
     10x17_new.font: width of a character is 10 pixels, height is 17 pixels
Each font-file must contain 256 characters.

Format of a font-file

Have a look into the shipped font-files under "share/": 8x8.font and 10x17.font
It is the same format atobm(1x) (from the X-window system) uses.
Each font-file must end with ".font".

font-file functions

With vg_font_width() and vg_font_height()
you get the width and height of the given font-file, which are identical to
the numbers in the name of the file.

different text languages
If your game supports different languages use vg_get_textformat()
to translate the original text before giving it out.
Refer to vg_get_textformat() for more information.



Back to Index