72Programming Font Loading

File Format

A font consists of a header describing the font, then data for every character in the font. The header has to be downloaded even if the font consists of a single character only. Below is a description of the font header.

This will be printed on status printouts. (For example, Swiss 10 cpi.)

1 byte

Reserved

Should always be 0 (zero)

 

 

 

1 byte

Char. width (X)

The number of bytes required for the width of one character, usually 2 or 3.

 

 

Range 1 to 8.

 

 

 

1 byte

Character pitch

The maximum width of one character in the set. This value is used for tab

 

 

position calculation. Range 1 to 255.

 

 

 

1 byte

Char. height (Y)

The maximum height of one character matrix measured in pixels. This is also the

 

 

minimum line spacing for this character set.

 

 

 

27 byte

Font name

String of characters used to identify the character set.

 

 

This field can also contain the name of the code page the font is generated with.

 

 

This is done with NUL separator between the font name and the code page name.

 

 

Then, the entire field should be padded with NUL up to 27 bytes.

 

 

Example:

 

 

Arial 8<0>Western<0><0><0><0><0><0><0><0><0><0><0><0>

Char_matrix table: 256 records, each containing 3 bytes.

3byte Char_width (pixels) + Char_Ystart(pixels) + Char_Yheight(pixels) Char_bitmap data: Bitmap data for all characters that are to be defined.

 

Char_width

 

Char_width

 

 

Char_width Char_width

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

A

 

Char_Ystart

A

W

g

Char_sizeY

 

 

 

 

 

 

Char_Yheight

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Baseline

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Char_sizeX

 

 

 

 

 

Char_pitch

Char_pitch

Char_pitch

P1002902-002

TTP 2000 Technical Manual

09/14/2009