13.2 Raster Glyphs

A raster-font file contains individual bitmaps for each glyph in the file. Each glyph bitmap is stored as a contiguous set of bytes. The first byte contains the first eight bits of the first scan line (that is, the top line of the character). The second byte contains the first eight bits of the second scan line. This continues until what amounts to a first “column” is completely defined.

The following byte contains the next eight bits of the first scan line, padded with zeros on the right if necessary (and so on, down through the second “column”). If the glyph is quite narrow, each scan line is covered by one byte, with bits set to zero as necessary for padding. If the glyph is very wide, a third or even fourth set of bytes can be present.

All bitmaps must be stored contiguously and arranged in ascending order, that is, the bitmap for the first character is first and the last character is last.

The following example shows the the bytes that form a 12 x 14 pixel character.

00 06 09 10 20 20 20 3F 20 20 20 00 00 00 /* first column */

00 00 00 80 40 40 40 C0 40 40 40 00 00 00 /* second column */

Notice that in the second set of bytes, the second digit corresponds to the
thirteenth through sixteenth pixels on the right side of the character. Since
the character is only 12 bits wide, these bits should always be zero.

The resulting character looks like this:

............

.....**.....

....*..*....

...*....*...

..*......*..

..*......*..

..*......*..

..********..

..*......*..

..*......*..

..*......*..

............

............

............