5. Available Fonts¶
The UniFeatherBot uses the public domain Hershey Fonts fonts distributed on the USENET network. The Hershey Fonts were originally created by Dr. A. V. Hershey while working at the U. S. National Bureau of Standards.
The format of the Font data in this distribution was originally created by:
James Hurt Cognition, Inc. 900 Technology Park Drive Billerica, MA 01821 (mit-eddie!ci-dandelion!hurt)
The fonts range from simple to complex and include many symbols. The standard UniFeatherBot does not have the movement accuracy to make all of the fonts practical. The more complex the font or the longer the message the more the movement errors will distort the text drawn.
5.2. Font file format¶
You do not have to understand the font file format in order to use the fonts in UniFeatherBot programs the library takes care of the details with the write function.
The font files begin with a 8 bit byte containing the number of characters in the front followed by a sequence of (little endian) 16 bit unsigned integers containing the file offset to the coordinate data for each of the characters in the font file. Fonts with 96 characters are in ASCII order for characters 0x20 though 0x7f. Other fonts have characters starting at 0x00.
The first byte of the coordinate data contains the number of x,y coordinates for the glyph. The second and third byte contain the coordinates for the left and right limits of the glyph. The following pairs of bytes are the x and y coordinates that make glyph. Like the original Hershey data each byte is offset by 0x52 (ascii ‘R’). A value of -50 for the x coordinate is used to indicate the pen should be raised for the next move.