.CPI : DOS Font File (Code page) Layout


by

Erik Bachmann
Clickety Click Software

1997-02-26

       Description           Content
      _________________________________________________  _____
   0 | File tag              |FFh                      |  ^
   1 | FFh followed by the   |'F'                      |  |
   2 | string: "FONT   "     |'O'                      |  |
   3 |                       |'N'                      | Fontfileheader
   4 |                       |'T'                      |  |
   5 |                       |' '                      |  |
   6 |                       |' '                      |  |
   7 |                       |' '                      |  |
     |-----------------------|-------------------------|  |
   8 | (RESERVED)            |                         |  |
   9 |                       |                         |  |
  10 |                       |                         |  |
  11 |                       |                         |  |
  12 |                       |                         |  |
  13 |                       |                         |  |
  14 |                       |                         |  |
  14 |                       |                         |  |
     |-----------------------|-------------------------|  |
  16 | No of pointer in      | 1                       |  |
  17 | header                |                         |  |
     |-----------------------|-------------------------|  |
  18 | Type of pointer       | 1                       |  |
     |-----------------------|-------------------------|  |
  19 | Offset to info from   |                         |  |
  20 | start of file (binary)|                         |  |
  21 |                       |                         |  |
  22 |                       |                         |  v
     |-----------------------|-------------------------| -|-----
  23 | No of entries (binary)|                         |  ^
  24 |                       |                         | Font Info Header
     |-----------------------|-------------------------| -|-----
  25 | Size of code  (binary)| 28h                     |  ^
  26 |                       |                         |  |
     |-----------------------|-------------------------| CP Entry Header
  27 | Pointer to next entry | 0000h for last entry    |  |
  28 |                       |                         |  |
  29 |                       |                         |  |
  30 |                       |                         |  |
     |-----------------------|-------------------------|  |
  31 | Device type           | 01h=display             |  |
  32 |                       | 02h=printer             |  |
     |-----------------------|-------------------------|  |
  33 | Device name (ID)      | ASCII text padded with  |  |
  34 |                       | blanks                  |  |
  35 |                       |                         |  |
  36 |                       |                         |  |
  37 |                       |                         |  |
  38 |                       |                         |  |
  39 |                       |                         |  |
  40 |                       |                         |  |
     |-----------------------|-------------------------|  |
  41*| Code page ID          | *41                     |  |
  42 |                       |                         |  |
     |-----------------------|-------------------------|  |
  43 | (reserved)            | Must be zero            |  |
  44 |                       |                         |  |
  45 |                       |                         |  |
  46 |                       |                         |  |
  47 |                       |                         |  |
  48 |                       |                         |  |
     |-----------------------|-------------------------|  |
  49 | Pointer to font info  | binary value            |  |
  50 |                       |                         |  |
  51 |                       |                         |  |
  52 |                       |                         |  v
     |-----------------------|-------------------------| -|----
  53 | (reserved)            | Must be 1               |  ^ 
  54 |                       |                         |  |
     |-----------------------|-------------------------| Font Data Header
  55 | No. of fonts          | binary value            |  |
  56 |                       |                         |  |
     |-----------------------|-------------------------|  |
  57 | Length of font data   | binary value            |  |
  58 |                       |                         |  v
     |=======================|=========================| -|----


*41) Code Page ID:  437, 850, 852, 860, 863 or 865


For Display Font
      _________________________________________________  _____
  59 | Rows in character box | binary value            |  |
     |-----------------------|-------------------------|  |
  60 | Columns in char. box  | binary value            |  |
     |-----------------------|-------------------------|  |
  61 | Aspect ratio          | 00h                     |  |
  62 | (not used)            | 00h                     |  |
     |-----------------------|-------------------------|  |
  63 | No. of chacters in    | Usually 256 (FFh)       |  |
  64 | font                  |                         |  V
     |-----------------------|-------------------------| -|----
  65 | Font data             | Stored as pixel         |  ^
  66 |                       | descriptions            |  |
     :                       :                         : Font data
     :                       :                         :  |
     :                       :                         :  |
  N  |                       |                         |  V
     |=======================|=========================| -|----


For Printer Font
      _________________________________________________  _____
  59 | Printer selection type| 1=4201, 2=5202/4208     |  ^
  60 |                       |                         |  |
     |-----------------------|-------------------------| Print font header
  61 | Total no. of bytes in | Must be < 31            |  |
  62 | control sequence      |                         |  V
     |-----------------------|-------------------------| -|----
  63 | Hardware code page    | Must be <= 31           |  |
     |                       |                         |  |
     :                       :                         :  |
     :                       :                         :  |
     :                       :                         :  |
  N  |                       |                         |  |
     |-----------------------|-------------------------|  |
  m  | Downloadable code     | Must be <= 31           |  |
     : page                  :                         :  |
     :                       :                         :  |
     :                       :                         :  |
  M  |                       |                         |  |
     |-----------------------|-------------------------|  |
  o  | Downloadable character| See: Printer Techical   |  |
     | definitions           |      Reference          |  |
     |                       |                         |  |
     :                       :                         :  |
     :                       :                         :  |
     :                       :                         :  |
  O  |                       |                         |  V
     |=======================|=========================| -|----

Source:

Hogan, T.
The programmer's PC sourcebook Reference tables for IBM PCs and compatibles. / T. Hogan. - Redmond, Wash., USA : Microsoft Press, 1991. - ISBN 1-55615-321-x

Note: Covers PS/2 systems. EISA-based systems. MS-DOS operating system through version 5. Microsoft Windows through version 3 Hundreds of new charts and tables !


END OF FILE