256-Character Font File Structure

Like 96-character font files, 256-character font files begin with two bytes that specify the bitmap width and height used in the font. However, the high order bit of the first (MaxX) byte is set for 256-character fonts. For instance, a MaxX value of 2 means this is a 96-character font with each character bitmap having a width of two bytes. But a MaxX of 82 hex indicates a 256-character font, also with each bitmap being two bytes wide.

In a 96-character font file, a font block follows the two size bytes. The font block contains the Xsizes table, the Ysizes table, and the bitmaps for all 96 characters. A 256-character font file has four such font blocks following the size bytes, with each font block containing data for 64 characters. That is, a 64-character font block contains a 64-byte Xsizes table, a 64-byte Ysizes table, followed by the bitmap data for 64 characters. The first font block contains data for ASCII characters 0 to 63, the second for 64 to 127, the third for 128 to 191, and the fourth for 192 to 255.

The following diagram shows the overall structure of a 256-character font file:

MaxX (1 byte with high order bit set)

MaxY (1 byte)

Font block 1 (characters 0-63)

Font block 2 (characters 64-127)

Font block 3 (characters 128-191)

Font block 4 (characters 192-255)

And each font block looks like this:

Xsizes table (64 bytes)

Ysizes table (64 bytes)

Bitmaps (64 * MaxX * MaxY bytes)

<< Prev

Next >>

Contents
Fastgraph Home Page

 

copyright 2001 Ted Gruber Software, Inc.