Font Driver Functions

In addition to the functions described in the previous topics, the following table lists several other functions that font drivers should support.

Function Description
DrvQueryFontFile Depending on the mode of the query, returns the number of font faces in a font file or in a descriptive string. Required for font drivers.
DrvQueryFontCaps Copies an array of bits defining the capabilities of a font driver to a specified buffer.
DrvLoadFontFile Specifies a file to be used for creating font realizations; the driver must prepare the file for use. Required for font drivers.
DrvUnloadFontFile Informs driver that a font file is no longer needed so driver can do necessary cleanup. Required for font drivers.
DrvQueryAdvanceWidths Asks the driver to send GDI character advance widths for a specified set of glyphs.

GDI calls DrvLoadFontFile with a particular file to be used for creating font realizations. This function is required only of font drivers. When DrvLoadFontFile is called, the driver performs the conversions necessary to prepare the file for use.

DrvLoadFontFile returns a unique identifier that allows GDI to request the correct font using a GDI-maintained font usage table. Once a font is loaded, GDI does not call for the same font to be loaded again.

GDI calls DrvUnloadFontFile when the specified font file is no longer needed. DrvUnloadFontFile is required only in font drivers. DrvUnloadFontFile causes all scratch files to be deleted and all allocated system resources to be freed.

GDI calls DrvQueryFontFile to return information about a font file that was loaded by the driver. DrvQueryFontFile is required only in font drivers. The type of information to be returned is specified by iMode. If iMode is QFF_DESCRIPTION, the function returns a string that Windows NT uses to describe the font file. If iMode is QFF_NUMFACES, the function returns the number of faces in the font file. The faces are identified by an index from the range 1 to number of faces.