The SCI font resource

SCI font resources remained unchanged during the SCI revisions and were still used in SCI32. Their format is relatively straightforward and completely sufficient for any 8 or even 16 bit character table:

Table 3-1. The SCI font resource data structure

OffsetTypeMeaning
016 bit integer, little endian encodingAlways zero (?)
216 bit integer, little endian encodingNUMCHAR: Number of characters
416 bit integer, little endian encodingHEIGHT: Number of pixel lines per text line
6 + NR * 216 bit integer, little endian encodingAbsolute offset of the character #NR, where 0 <= NR < NUMCHAR

HEIGHT does not affect the height of a character, though- it only tells the interpreter how far to move downwards when displaying a line of text. The characters referenced to starting at offset 6 are encoded as follows:

Table 3-2. The SCI font resource character data structure

OffsetTypeMeaning
0unsigned 8 bit integercharacter HEIGHT
1unsigned 8 bit integercharacter WIDTH
2...bitmask, size HEIGHT * round_up(WIDTH / 8)Bitmask for the character
The bitmap consists of HEIGHT lines of n bytes, where n equals the number of bytes required for storing WIDTH bits. Data is stored with the MSB first, in little-endian encoding (first byte describes the 8 leftmost pixels), where a pixel is drawn iff the bit it corresponds to is set.