A.2. The DOS World
A.2.1. The CPI Format
The DOS font format is CPI (for "Code Page Information", in the Microsoft sense; see page 45). The peculiarity of the CPI fonts is the fact that they contain several fonts, arranged first by code page, then by type size.
They are console fonts, therefore monospaced; what is more, they have a constant width equal to 8 pixels (which is equal to 8 bits, or 1 byte). Usually three sizes are found: 8, 14, and 16 pixels. Each font contains exactly 256 glyphs.
The structure of CPI fonts [91] is quite natural: there is a global heading, then the file is divided into sections corresponding to code pages (each with its own heading), themselves subdivided into subsections corresponding to the various available sizes, and each subsection again has its own heading and, finally, the bitmap data for the size in question.
The global heading is fixed:
ff 46 4f 4e 54 20 20 20 00 00 00 00 00 00 00 00
01 00 01 17 00 00 00 01 00
except for the last two bytes, which indicate the number of code pages supplied in the file (in this case, just one; the number 1 is written in little-endian order).
Next comes a section for each code page, with the following heading:
a fixed 2-byte number: 00 1c; a 4-byte pointer to the heading of the following code page (or ff ff ff ff); a 2-byte number with the value 1 (screen font) or 2 (printer font); an 8-byte ASCII string to indicate the type of screen/printer (for example, "EGA "); the Microsoft code-page number, written as ...