Go to the first, previous, next, last section, table of contents.

QFAX Font Format

QFAX Font pre v2.7

Prior to QFAX v2.7, the QFAX font comprised 16 horizontal by 28 vertical pixels per character. Each character is thus defined by fifty six consecutive bytes arranged in ascending address from top left to bottom right.

 ---------------
| n+0   | n+1   |       (top pixel line)
|-------+-------|
| n+2   |       |
|-------+-------|
    .......
|       |       |
|-------+-------|
| n+54  | n+55  |       (bottom pixel line)
 ---------------

where the starting address, (n, from the base of the font) is given for ASCII code X as X * 56. Thus the character 'A' (ASCII 65) is offset 3640 (65 * 56) bytes from the start of the font and the complete font is 14336 bytes.

Within each character 'cell', the leftmost pixel is represented by the most significant bit. The character 'A' (ASCII 65) is represented by the sequence of hex bytes:

(offset 3640)
|
V
00 00 00 00 01 80 07 e0 0f f0 1e 78 3c 3c
78 1e 70 0e 70 0e 70 0e 70 0e 70 0e 70 0e
70 0e 7f fe 7f fe 70 0e 70 0e 70 0e 70 0e
70 0e 70 0e 00 00 00 00 00 00 00 00 00 00
                                       ^ 
                                       |
                                       Offset 3695

QFAX Font v2.7+

I am extremely reluctant to add yet another font format to a world that is already overflowing with them, however I am unable to find a publicly documented, freely available source of suitable fonts for SMS/QDOS. At least this format is documented.

New format QFAX fonts (v2.7 and greater) can be any reasonable size and may be proportional. These fonts have a header as follows.

typedef struct
{
    char flag[8];       /* "QfaxFont" */
    unchar xpix;        /* Char width in pixels */
    unchar ypix;        /* Char height in pixels */
    unchar first;       /* ASCII value of first char */
    unchar last;        /* ASCII value of last char */
    unchar top_l;       /* Top margin */
    unchar bot_l;       /* Bottom margin */
    unchar right;       /* Right margin */
    unchar mode;        /* Mode, '\0' = mono, 'P' = proportional */ 
    long  fsize;        /* Size of character bitmap (bytes)
    unchar font[1];     /* Bitmap data */
} QFONTHDR;

The rest of the data is the font bit map. This is organised as above, i.e. the leftmost pixel on screen occupies the leftmost (high bit) (0x80). The data is packed (i.e. no alignment to any byte boundary).

For proportional fonts, the xpix field is the average width, and a table describing the width of each character (1 byte per character) follows immediately after the font bitmap (for example, if the font has characters 32 through 127, then the proportional width table would be 96 bytes long.


Go to the first, previous, next, last section, table of contents.