Skip to content

Font Packages (.bin)

Current font package version: 2

Below, you can find information on the format for font package files. The format is based loosely on the format used by Halo 2, with various changes made to suit our needs better.

Remember: Any sizes that begin with 0x indicate a hexadecimal (base 16) length. Ex: 0x10 is equal to decimal 16.

File Header#

Address range: 0x0 -> 0x3FF

  • 0x0 -> 0x3 - File header start, will always contain the text BFNT, used to confirm that a proper font file is being loaded
  • 0x26 -> 0x27 - Font package version, updated when font packages are upgraded to a newer format to aid in backwards compatibility
  • 0x11C -> 0x13B - Earliest engine version to support this font package version
  • 0x170 -> 0x173 - Length of bytes for TrueType file
  • 0x174 -> 0x177 - Offset of TrueType file
  • 0x178 -> 0x17E - Reserved for future use
  • 0x17F -> 0x19F - Font ID
  • 0x1A0 - Whether or not the font is a TrueType file
  • 0x1A1 - Whether or not the font is monospaced
  • 0x1A2 - Font size
  • 0x1A4 - Monospaced font width
  • 0x1A6 - Character spacing
  • 0x1A8 - Width of space character
  • 0x1AA -> 0x1CA - Display name of TrueType font
  • 0x1CB -> 0x1CC - Height of each line in pixels. Used for newline placement.

Remaining space is unused and is left blank for any future format changes.

Character List (Bitmap Only)#

Address range: 0x400 -> 0x403ff

Lists each character supported by the font package. Each character has 4 bytes to account for any extra space for unicode or multi-byte characters. The order of the characters act as the index in the index table.

Index Table (Bitmap Only)#

Address Start: 0x040400
Address End: <amt. of characters> * 0x10

Each character contains the following properties (offsets are relative to the start of the index):

  • 0x00 - Glyph width
  • 0x02 - Glyph height
  • 0x04 -> 0x08 - Length of image data
  • 0x09 - Image Format
    • 00 - PNG
    • .. - Other formats will be added here as they are supported in-engine
  • 0x0A -> 0x0B - Reserved
  • 0x0C -> 0x0F - Offset to character bitmap data

Bitmap Data (Bitmap Only)#

Address Start: <end of index table>
Address End: <end of file>

This section contains the raw image data. The formats will differ based on glyph image format. These are entirely unchanged from their original file formats.

TTF Font File (TrueType Only)#

Address Start: 0x400
Address End: <end of file>

This section contains the raw data of the TrueType file, unaltered.