Command Summary
29
Table 22: Example
Font File Header
Maximum Width Character Height ASCII Start Value ASCII End Value
5
7
104
106
The font file header contains four bytes: First, the number of columns in the widest character; usually
‘w’, second, the pixel height of each character, and finally, the start and end values of the character
range. The range represents the values that must be sent to the display to trigger the characters to
appear on the screen. In the example, the decimal values corresponding to the lowercase letters ‘h’
through ‘j’ will be used resulting in the range shown.
Table 23: Example Character Table
MSB LSB Width
h
0
13
5
i
0
18
3
j
0
21
4
The character table contains information that allows the display to locate each individual character in a
mass of character data. Each character has three bytes; two indicating it’s offset in the character data
and one indicating its width. The offset takes into account the header and table bytes to point to the
first byte of the character data it references. The first byte of the file, maximum width, has an offset of
zero. The width byte of each character can be identical as in a fixed width font, or in our case, variable.
The character table will become clearer after analyzing the final part of the font file, character data.
Table 24: Character ‘h’
Bitmap
1
0
0
0
0
1
0 0 0 0
1
0
1
1
0
1 1
0 0
1
1
0
0
0
1
1
0 0 0
1
1
0 0 0
1
Table 25: Character ‘h’ Data
1
0
0
0
0
1
0
0
84
132
0 0
1
0
1 1
0
1
2D
45
1
0 0
1
1
0 0
0
98
152
1 1
0
0
0
1
1
0
C6
198
0 0
1
0 0
0 0 0
20
32
The character data is a binary graphical representation of each glyph in a font. Each character is drawn
on a grid containing as many rows as the height specified in the header and as many columns as the
width specified in the character table. Cells are drawn by writing a one in their location and cleared by
setting a value of zero. Starting at the top left, moving right, then down, eight of these cells form a
character data byte. When all cells are accounted for, zeroes may be added to the last byte to complete
it. A sample of an ‘h’ glyph is shown above. The data for the ‘i’ and ‘j’ characters will follow to complete
the custom font file displayed below.