.font.ini (Config pack)

.font.ini - is the PGE Project specific raster font format.

=Features and disadvantages=

Features

 * Full Unicode support.
 * Missing characters are using TTF subsystem as a fallback.
 * Support for both mono-space and proportional fonts.

Disadvantages

 * Width cut-off correction is limited with a 9 pixels maximum offset for each side.
 * No support for diacritical signs with relative position offsets.
 * One font will contain lot of files in dependence on a count of included character maps.
 * Non-intuitive character entry format.
 * No support for encoded character symbols to specify the character by it's full code rather placing the character itself.

=Main font profile= This file explaining the font and includes the list of font maps. The font profile must always have the ".font.ini" suffix.

List of font maps are used in this font. Each font map includes one sprite - a picture contains drawn letters and map of cells in that image in dependence on UTF8 character. Where is "table*" means the number at 1 which specifies each font map:

=Font map file= Font map contains the characters set mapped to the matrix texture where are actual characters was drawn. Must be saved into UTF-8 format without of BOM! The filename of a font map is defined in the raster profile.

Map of font. Defines the available characters which can be printed.

Monospace fonts
Those fonts are have same width of characters. Each entry has next syntax inside of "entries" section:

y0-x1 = "UTF-8 encoded letter"

Example:

0-1 = "X"


 * Where y0 - the 0 to N number of the vertical cell where the character is drawn on a texture.
 * Where x1 - the 0 to N number of the horizontal cell where the character is drawn on a texture.
 * Where X - the actual character which will be assigned to the specified position.

Proportional fonts
Those fonts can have characters of different width. There are can be done with left-right padding subtracting. Example:

0-1 = "X23"


 * Where is "0-1" - the X=1 and Y=0 position on the texture
 * Where is "X" - the actual character which will be assigned to the specified position.
 * Where is "2" - the 0-9 left width cut-off on the character. Means how much pixels will be chopped from the character width at left side.
 * Where is "3" - the 0-9 right width cur-off on the character. Means how much pixels will be chopped from the character width at right side.

In this example your character will have final width less than original with difference of 5 pixels (2 at left, and 3 at right).

Assign the same texture position by different characters
When you need to specify the same texture cell for two different characters (for example, for upper "X" and lower "x"), the "Z" discriminator can be used:

y0-x0-z0 = "X"

Example:

0-1-0 = "X" 0-1-1 = "x"


 * Where y0 - the 0 to N vertical cell on the texture
 * Where x0 - the 0 to N horizontal cell on the texture
 * Where z0 - the discriminator value which means nothing, but is used to allow assigning of multiple different characters into the same texture cell.
 * Where "X" and "x" - are characters assigned to the given texture position.

=Example font= The complete example of the raster font with the full setup of most of properties.