*.SWF Swecoin Font Format - For All Swecoin Printers Written By Jonathan Hunt This format is used in All Swecoin printers that support multiple fonts, including the TTP 5200, TTP 1020, And Some Cale Products. The format is as follows: Header: ****************************************************************** Bytes Decription 1 Filler Byte, Font Number 1 Filler Byte, Charcter Set Number 1 The number of bytes per charcter This value, times 8, gives the maximum width in pixels for the font. Because these fonts are bitmapped, this value is usualy 2 or 3 1 Charcter Pitch This is the maximum width of a charcter in the set For example, if your font is 5 by 7 pixels, you would set the previous value to 8, and this value to 5. This value is used mainly for calculating tab positions, 1 Total Y Size The maximum height of the charcters. This is also the minimun line spacing value. In the 5x7 example, it would be 7. 27 Name Always 27 bytes, a descriptive name of the font, padded with zeros. Matrix ******************************************************************* Next, for each of the 256 (0 to 255) charcters in the font, there are three bytes stored. All bytes must be specified. The matrix format is as follows: Byte Num Description 1 This Charcters Width in Pixels 2 This Charcters Y Starting Postion (more later) 3 This Charcters Y Height in Pixels About Y Starting Postion: In order to reduce space consumed in the printer, the fonts use the following primitive empty space removal. If you have a 5 x 7 pixel charcter, and it was the period charcter, it might look like the following: 12345678 1 .....<<< . = Blank Pixel 2 .....<<< < = Wasted (Unused) Pixel 3 .....<<< X = Lit Pixel 4 .....<<< 5 .....<<< 6 ..XX.<<< 7 .....<<< Notice that this charcter does not start having any data until line 6. Rather than Add an additional 5 bytes to the charcter, we can simply specify the second byte as 6 in the matrix of this charcter. Also note, that if the width byte is 0, no data is read for the charcter. Bitmap Data ********************************************************************** The Bitmap data is monochrome bitmap data, IE: ........XXXXXXXX....<<<< 123456781234567812345678 \/ \/ \/ 00 h ff h 00 h You have to specify all wasted bytes. You should fill them with zeros. If you have any Q's Regarding this format, Email Jonathan.H@swecoinus.com