Page:NBS Technical Note 11176 (1983) (IAutilityprogramsf1176dick).djvu/14

This page has been proofread, but needs to be validated.

not the coordinates of the next point, but the offset required to arrive at that location. In addition, the character numbers have been deleted. In general, each string consists of a series of ASCII characters in the format:

W XY ? XY XY XY ? XY XY ? XY

where the first character, W, indicates the width of the character, the next pair, XY , indicates the offset to the start of the character, the character, ?, indicates a change of pen status, etc. In order to obtain the maximum possible flexibility in the storage of the characters, each character stored is the ASCII character corresponding to the offset +93 (i.e. an offset of +1 is stored as CHR$(94)=^). In this scheme then, the string corresponding to the character. A, given by the Hershey vectors above is stored as:

'""?YT?!&?!t?WZ?J?! ^

where the vectors are now stored in a format where positive vertical displacements are in the upward direction. Note that this technique allows the character to be stored in 22 bytes whereas the previous representation would require at least 33 bytes even if the foregoing compression scheme were used to represent pen changes. In addition, the final vectors represent the offset necessary to advance the pen to the right hand character limit.

CANDY APPLE

The program for manipulating these Hershey text files is given in Listing 1 and is written in Applesoft Basic (20). In general, the program is self-explanatory and menu-driven; it is broken up into the following sections:

Line numbers Program function
10-199 Main menu and initialization; also contains the disk assignment routine.
1000-1460 Hershey character input routine using the tabulated Hershey vectors.
2000-2130 Write font to disk as a text file.
3000-3260 Routines to modify a font.
- 5 -
C.E. Dick and J.Hilsenrath