This document describes the font format used by the Wasteland 1 COLORF.FNT file.
It covers:
COLORF.FNT contains a sequence of fixed-size font glyph records.
Each glyph is:
8 pixels8 pixelsThere is no header, no compression wrapper, and no per-glyph metadata.
The file is a simple concatenation of fixed-size glyph records until EOF.
32fileSize / 32For a valid file, the total file size must be a multiple of 32.
In the shipped Wasteland 1 data:
colorf.fnt is 5504 bytes172 glyph recordsEach glyph record is 32 bytes long and consists of four 1-bit planes of 8 bytes each:
| Offset | Size | Meaning |
|---|---|---|
+0x00 |
8 |
Blue plane |
+0x08 |
8 |
Green plane |
+0x10 |
8 |
Red plane |
+0x18 |
8 |
Intensity plane |
Each plane stores one byte per image row:
8 rows1 byte per row8 pixels per byteBits are read most-significant-bit first within each byte.
For a pixel (x, y):
bitIndex = 7 - x
The plane bytes for row y are:
blueByte = data[y + 0]
greenByte = data[y + 8]
redByte = data[y + 16]
intensityByte = data[y + 24]
So each row is distributed across four different bytes, one in each plane.
The final 4-bit palette index is built from the four plane bits:
blueBit = (blueByte >> bitIndex) & 1
greenBit = (greenByte >> bitIndex) & 1
redBit = (redByte >> bitIndex) & 1
intensityBit = (intensityByte >> bitIndex) & 1
Combined as:
colorIndex =
(blueBit << 0) |
(greenBit << 1) |
(redBit << 2) |
(intensityBit << 3)
This yields a 4-bit color value in the range 0..15.
Unlike the sprite and cursor formats, COLORF.FNT does not contain a separate transparency mask. Every glyph pixel is always visible and is represented directly by its 4-bit palette index.
To decode glyph n:
32 bytes from the file at offset n * 32.(x, y), read one bit from each of the four planes for row y.Useful consistency checks when implementing a reader:
3232 bytes8 bytes