beautypg.com

Matrix Orbital GLK24064-25 Legacy User Manual

Page 24

background image

5.1.1

Font File Format

A font file consists of three parts, a header, a character table and bitmap data.

1. Header (4 bytes)

(a) Nominal Width (1 byte)

(b) Height (1 byte)

(c) ASCII Start Value (1 byte)

(d) ASCII End Value (1 byte)

2. Character Table (3 bytes for every character between the ASCII Start and End values inclusive)

(a) High Offset MSB (1 byte)

(b) Low Offset LSB(1 byte)

(c) Character Width (1 byte)

3. Bitmap Data

5.1.2

Creating a Font

The following is an example of how to create a font file for the letters h, i and j.
First you must create the bitmaps containing the character data in bitmap form. Figure 20 below illus-

trates the bit pattern for the h, i and j bitmap data.

Figure 20: Bitmaps for h, i, and j

Second you may begin to create the font file starting with the header. The header will contain the nominal

width, the height and the ASCII start and end values inclusive that you wish to create characters for.

Table 8: Font File Header

Nominal Width

Height

ASCII Start Val

ASCII End Val

0x05

0x07

0x68

0x6A

Next we will have to find out how many bytes each character will use up, in order to create the character

table. The bitmaps are encoded horizontally and may have variable widths, h has a width of five, i a width
of three and j a width of four, see the figure below for an example of encoding the first letter h:

Matrix Orbital

GLK24064-25

19