FON2

A FON2 font, or big font, contains an arbitrary amount of paletted characters. It is of this form:

OffsetLengthNameContent
0x00004*1IdentifierThe characters 'F', 'O', 'N', and '2'.
0x00042HeightUnsigned value for character height.
0x00061FirstASCII number for the first character described in the font.
0x00071LastASCII number for the last character described in the font.
0x00081Constant width1 if the characters are of constant width, 0 otherwise.
0x00091Shading typeSeems unused.
0x000A1Palette sizeAmount of active colors in the palette. The true palette size is one greater, as the last palette entry is for the inactive color.
0x000B1FlagsTechnically used as a boolean, since there is only one flag. 1 if the font contains kerning information, 0 otherwise.

If there is kerning information, the header is followed by a signed two-byte value for it.

After the header and the possible kerning info are the character widths. If the font is monospaced, this is a single two-byte unsigned value, used by all characters. Otherwise, this is a series of such values, one per character. A null value can be used to signify a character is skipped.

Then comes the built-in palette for the font, with (palette size + 1) × 3 bytes describing the color value of each entry in standard RGB format. The first index is a transparent color, the last index is used to create "boxes" around each character and is considered transparent as well. They have no special purpose in ZDoom, but are used by imagetool to identify each character so as to convert back and forth between image format and FON2 format.

Finally comes the RLE-encoded data for each described character in sequence. Each character form a single image of character width × character height pixels, and there can be no RLE overflow between one character and the next. Unless the characters are monospaced, the font can not be directly displayed as an image.

ZDoom provides three FON2 fonts in files named dbigfont.lmp, sbigfont.lmp and indexfont in zdoom.pk3. They are used respectively as the big fonts for Doom and Strife, and as the index font for the alternate HUD.

This article is issued from Zdoom. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.