Font File Format (GRAPHCHR.DAT and CHARSMAL.DAT)

From WTFwiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

The contents of this page are pretty much a copy/paste of a post ChaosBlackMagic's made on the subject.

GRAPHCHR.DAT:

This is the large OMF font. For each printable Extended ASCII character (that is, those characters c >= 0x20), this file contains 8 bytes containing an 8x8 bitmap defining the appearance of the character; each byte defines one row of a character. Character c starts at offset 8 * (c-32) in the file.

As an example, the character "A" has c = 65, so its appearance is described by bytes 264 to 271 of the file, which are, in hexadecimal and binary:

@264 0x78 01111000
@265 0xC4 11000100
@266 0xC4 11000100
@267 0xFC 11111100
@268 0xC4 11000100
@269 0xC4 11000100
@270 0xC4 11000100
@271 0x00 00000000

Note that the low-order bit is rendered rightmost.

CHARSMAL.DAT:

This is the small OMF font. The format is exactly the same as that of GRAPHCHR.DAT, except that each character is represented by a 8x6 bitmap, so there are only 6 bytes per character.

External Links

--Andrew 02:40, 17 February 2007 (EST)