Byte Map Font

A Byte Map Font, or BMF, contains an arbitrary amount of paletted characters.

It is of this form:

OffsetLengthNameContent
0x00004Identifier0x1AD5E6E1
0x00041VersionNormally 0x11
0x00051Line heightUnsigned value
0x00061Size over the base lineSigned value
0x00071Size under the base lineSigned value
0x00081Space after each character, in addition to each character's own shiftSigned value
0x00091Inner size (?)Signed value
0x000A1Count of used colors (not the same as palette size)Unsigned value
0x000B1Highest used color indexUnsigned value
0x000C4Reserved valuesShould be 0x00000000
0x00101Number of RGB entries in the paletteUnsigned value
0x0011x*3PaletteA series of 6-bit RGB values, starting from palette index 1 (index 0 is transparent and not described).

After the palette comes an information string about the font:

OffsetLengthNameContent
0x00001SizeUnsigned value
0x0001xInfoASCII characters

After the string comes a two-byte, little-endian unsigned value for the amount of characters. Then comes the character data:

OffsetLengthNameContent
0x00001Which characterASCII character
0x00011WidthUnsigned value, size of the character image
0x00021HeightUnsigned value, size of the character image
0x00031X-offsetSigned value, offset of the character image relative to the cursor
0x00041Y-offsetSigned value, offset of the character image relative to the cursor
0x00051ShiftHorizontal cursor shift after drawing the character (used instead of width) in addition to the global font value of space added after each character
0x0001xInfoCharacter image as raw pixels in row-major format

Characters are listed one after the other until the end of the file. Note that some characters may have a null image (0 width and/or 0 height); spaces are likely to have no image and instead be defined only by the shift value.

  • BMF Homepage - contains a couple of utilities and a large collection of fonts
This article is issued from Zdoom. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.