FNT field reference
File page · Format catalogue · Schema source
This page is generated from the Kaitai schema FNT.ksy each time the site is built. The schema is the authoritative description; statements are established unless marked inferred or unknown, and the evidence is listed on the file page (see the reading guide).
- Schema: Eye of the Beholder II DOS fonts (FNT)
- Byte order: little-endian
- File extension:
fnt - Schema license:
MIT
Description
A bitmap font of 128 characters, numbered 0 to 127 by their ASCII code. FONT6.FNT draws characters 6 pixels wide and high; FONT8.FNT 8 by 8. The game loads both at start-up. FONT8.FNT comes with the display driver and is the font of the start menu; it is installed again for the two-choice questions, the defeat message and the ending. FONT6.FNT is installed when a game starts and is the font of the play screen. See the format overview.
The file is read whole. A glyph is reached through the offset table: the word at byte 2 × (character + 1). Bytes 258 and 259 give the height of every glyph in rows and its width in pixels, which is also the advance from one character to the next. Each row of a glyph takes one byte per eight pixels of width; the most significant bit is the leftmost pixel, a set bit is drawn in the text colour and a clear bit in the background colour.
In both original files the glyphs follow the header in character order,
each height bytes long, the first at byte 260, and the last ends on the
last byte of the file.
File structure
| Field | Type | Size, repetition and constraints |
|---|---|---|
data_size | u2 | — |
glyph_offsets | u2 | repeated 128 times |
height | u1 | — |
width | u1 | — |
data_size
The size of the file after this word: 1026 in FONT6.FNT and 1282 in FONT8.FNT. The game allocates a block of this size and reads this many bytes into it, 2 bytes from its start, so that offsets in the block are offsets in the file; the block's first word stays zero.
glyph_offsets
Byte offset, from the start of the file, of the glyph of each character 0 to 127.
height
Height of every glyph in rows; 6 in FONT6.FNT, 8 in FONT8.FNT.
width
Width of every glyph in pixels, also the advance between characters; 6 in FONT6.FNT, 8 in FONT8.FNT. The driver draws nothing for a width outside 1 to 24.
Derived values and positioned data:
| Field | Type | Size, repetition and constraints |
|---|---|---|
glyphs | glyph(_index) | repeated 128 times |
glyphs
The 128 glyphs, by character number.
Type glyph
Parameters: index (u1)
Derived values and positioned data:
| Field | Type | Size, repetition and constraints |
|---|---|---|
rows | 1 bytes | repeated _root.height * ((_root.width + 7) / 8) times; at position _root.glyph_offsets[index]; in stream _root._io |
rows
The glyph's rows, top to bottom, (width + 7) / 8 bytes each; most significant bit leftmost.