Font files consist of a font header, a character-width table, and the glyph data. The font header has the following format:
typedef struct tagFONTFILEHEADER {
short dfVersion;
long dfSize;
char dfCopyright[60];
FONTINFO dffi;
} FONTFILEHEADER;
The dfVersion member specifies the version of Windows for which the font was designed. For example, for fonts designed for Windows 3.1, this member is set to 0x30A. The dfSize member specifies the size in bytes of the entire font file and the dfCopyright member contains the font designer's null-terminated copyright string. The rest of the FONTFILEHEADER structure is identical to the FONTINFO structure.
The character-width table for the font file immediately follows the FONTFILEHEADER structure. The format of the table depends on the font-file version and whether the font contains raster or vector glyphs. For more information about the character-width table formats, see the FONTINFO structure in Chapter 12, “Graphics-Driver Types and Structures.”
The glyph data usually follows the character-width table. However, the dfBitsOffset member in the FONTINFO structure always specifies the offset from the beginning of the file to the start of the data. The data represents either raster or vector glyphs. The following sections describe these formats in detail.