Game Development Reference
In-Depth Information
There are a number of options we haven't explored in this run-through, as most of
the time you won't need to worry about them. In particular, we skipped the panel
labeled Input (per range) Options entirely.
This panel provides control over font features such as kerning, which is the offset
between the characters of a font. Kerning can sometimes be useful for bringing
certain character combinations closer together. For example, consider the capital
letters A and V. The shapes of these characters mean you may want to draw them
slightly closer to provide a more natural looking result when they are displayed
next to each other.
You can also declare subranges of characters, which allow you to apply different
global settings to certain ranges of characters. You can use this facility to use
completely different sizes of characters or even completely different source fonts, for
different character ranges. This can be particularly useful if we want to create a font
that contains characters from the standard ASCII set and characters from another
language. The font we use for the ASCII characters may not contain the characters for
the other language, so we can create a sub range that allows us to pick a completely
different font for those characters.
The GXFONT file format
The font builder utility creates two types of files to define a font resource. The first of
these is the actual font bitmap, which is exported in the Targa file format, an image
file format usually identified by the file extension .tga .
The second file exported is a GXFONT file , which acts as both a way of allowing the
font to be reloaded into the font builder for further editing, and a way of loading the
font into our own programs.
The following is an example GXFONT file for a font containing only numeric
characters drawn using the standard Windows font Arial Black at 20 points:
//Temp file created by AS Font Builder (User: Sean At: 06/29/12
18:00:06)
//Command Line:
//: -fontdesc "0;-27;0;0;0;900;0;0;0;0;3;2;1;34;Arial Black" 0 4 0
-pad 0 0
//: -col #FFFFFF -shadow 0 -spacing 4 -force16 0
CIwGxFont
{
utf8 1
image numbers.tga
charmap "0123456789"
}
 
Search WWH ::




Custom Search