DrvLoadFontFile

ULONG DrvLoadFontFile(

ULONG iFile,
PVOID pvView,
ULONG cjView,
ULONG ulLangID
);

DrvLoadFontFile identifies the file used to create fonts.

Parameters

iFile

Handle to the file that contains font data. The driver should retain this handle for subsequent calls to EngMapFontFile, as the font file may be unmapped until it is actually used.

pvView

Pointer to the memory-mapped font file.

cjView

Size, in bytes, of the view pointed to by pvView.

ulLangID

Specifies the language ID used when returning a locale-dependent string or name information.

Return Value

The return value is a unique identifier for a font file if the function is successful. Otherwise, it is FD_ERROR.

Comments

When DrvLoadFontFile is called, the driver should do any conversions necessary to prepare the file for use. If a font driver uses other DLLs, then it is responsible for ensuring that the DLL addresses to be accessed are valid.

Each font driver could obtain the parameters pvView and cjView by passing iFile to EngMapFontFile. However, for performance reasons, GDI calls EngMapFontFile once when loading fonts to obtain pvView and cjView, determines which font driver supports the font data in the file, and then calls that driver's DrvLoadFontFile implementation with pvView and cjView. Font files can be unmapped until they are actually going to be used, so drivers should record iFile to do the remapping later.

DrvLoadFontFile returns a unique identifier that allows the graphics engine to request the correct font. The graphics engine maintains a font usage table. After a font is loaded, the graphics engine will not try to load the same font again.

DrvLoadFontFile is required for font drivers.

See Also

DrvUnloadFontFile, EngMapFontFile