13.3 Vector Glyphs

A vector-font file contains a series of vectors for each glyph in the file. Each vector is a signed coordinate pair specifying the amount to move the pen relative to the current position. The size of each coordinate depends on the size of the font. If either the dfPixHeight or dfMaxWidth members in the FONTINFO structure is greater than 128, the coordinates are stored as 2-byte quantities; otherwise, they are stored as 1-byte quantities.

Each coordinate pair may be preceded by a value indicating whether the pen's tip should be lifted before moving. The tip-up value depends on the size of the coordinates. For 1-byte coordinates, the value is -128 (0x80) and for 2-byte coordinates, the value is -32768 (0x8000).

To draw the a vector glyph, a device moves the pen to the character cell origin. The origin is assumed to be at the upper-left corner of the character cell. The device moves the pen to new positions as specified by each vector. Positive co-ordinates move the pen down and to the right; negative coordinates up and to the left. If the tip-up value is given, the tip stays up for the subsequent coordinate pair only. The number of vectors for a glyph depends on the glyph. The number of bytes in the vector series is equal to the difference between the offsets from the character-width table for the given character and the next character.

The following series of vectors draws an exclamation point:

-128, /* pen tip up */

5, 4,

-1, 2,

1, 12,

1, -12,

-1, -2,

-128, /* pen tip up */

0, 2,

0, 6,

-128, /* pen tip up */

0, 11,

-1, 1,

1, 1,

1, -1,

-1, -1

If the character is drawn in a 10 x 24 character cell, the resulting character looks like this:

..........

..........

..........

....*.....

....*.....

...***....

...***....

...***....

...***....

...***....

...***....

...***....

....*.....

....*.....

....*.....

....*.....

....*.....

....*.....

..........

..........

..........

..........

....*.....

...*.*....

....*.....