BFNT (File Format)
From Wexos's Wiki
BFNT (Binary FoNT) is a font file format used in Mario Kart Arcade GP DX and Luigi's Mansion Arcade.
File Format
The file byte order is always little endian.
Header
The file starts with the following header:
| Offset | Type | Description |
|---|---|---|
| 0x00 | Char[4] | File magic. Always BFNT in ASCII. |
| 0x04 | Int32 | Font size. |
| 0x08 | Int32 | Is bold. |
| 0x0C | Int32 | Is italic. |
| 0x10 | Int32 | Is Unicode. |
| 0x14 | Int32 | Stretch height. |
| 0x18 | Int32 | Is smooth. |
| 0x1C | Int32 | Unknown. Related to anti-aliasing? |
| 0x20 | Int32[4] | Font padding. |
| 0x30 | Int32[2] | Font spacing. |
| 0x38 | Int32 | Outline width. |
| 0x3C | Int32 | Line height. |
| 0x40 | Int32 | Line base. |
| 0x44 | Int32 | Scale width. |
| 0x48 | Int32 | Scale height. |
| 0x4C | Int32 | Number of pages (P). |
| 0x50 | Int32 | Is packed. |
| 0x54 | Int32 | Is alpha channel. |
| 0x58 | Int32 | Is red channel. |
| 0x5C | Int32 | Is green channel. |
| 0x60 | Int32 | Is blue channel. |
Pages List
After the header, there's a struct of 8*P bytes for each font page.
| Offset | Type | Description |
|---|---|---|
| 0x00 | Int32 | Page ID. |
| 0x04 | Int32 | Page name offset relative to the Strings section. |
Character List
After the page list, there's the characters section.
| Offset | Type | Description |
|---|---|---|
| 0x00 | Int32 | Number of characters (C). |
Character
Each character definition is 0x28 bytes long.
| Offset | Type | Description |
|---|---|---|
| 0x00 | Int32 | Character ID. |
| 0x04 | Int32[2] | XY position. |
| 0x0C | Int32 | Character width. |
| 0x10 | Int32 | Character height. |
| 0x14 | Int32 | XY offset. |
| 0x1C | Int32 | X advance. |
| 0x20 | Int32 | Page ID. |
| 0x24 | Int32 | Channel. |
Strings
After the characters, there's a section with null-terminated strings that refer to external DDS file names for each page, without extension.
Tools
The following tools can handle BFNT files:
- (none)