FDLOADFONTFILE (Windows Embedded CE 6.0)

1/6/2010

Applies to Windows Embedded CE 6.0 R2

The FDLOADFONTFILE function receives information from GDI relating to loading and mapping font files.

Syntax

ULONG_PTR FDLOADFONTFILE(
    ULONG cFiles,
    ULONG_PTR *piFile,
    PVOID *ppvView,
    ULONG *pcjView,
    DESIGNVECTOR *pdv,
    ULONG ulLangID,
     ULONG ulFastCheckSum
);

Parameters

  • cFiles
    [in] Indicates the number of files associated with the font.
  • piFile
    [in] Pointer to a cFiles–sized array of file handles. Each handle represents one of the files associated with the font. The file handles can be passed individually to EngMapFontFileFD.
  • ppvView
    [in] Pointer to a cFiles–sized array containing the starting address of the memory space into which each font file has been mapped.
  • pcjView
    [in] Pointer to a cFiles–sized array containing the size of the memory space into which each font file has been mapped.
  • pdv
    [in] This parameter is NULL.
  • ulLangID
    [in] Language identifier obtained from the registry.
  • ulFastCheckSum
    [in] Specifies a GDI–supplied checksum for the font. If this parameter is nonzero, the GDI font cache engine can be used in order to access a font more quickly. If this parameter is zero, the GDI font engine cannot be used.

Return Value

If the operation succeeds, it returns a pointer to a driver–defined value that uniquely identifies the font. This pointer will be used as an input parameter for driver functions such as FDQUERYFONTand FDQUERYFONTFILE. If an error is encountered, this function returns HFF_INVALID.

Remarks

Font drivers are required to supply a FDLOADFONTFILE function. The function enables a font driver to receive notification that a font's associated files are being loaded and mapped. The driver can store input arguments for later use.

EngMapFontFileFD is called when a font file is loaded and mapped. When an application calls AddFontResource or AddFontResourceEx, GDI calls EngMapFontFileFD and then calls DrvLoadFontFile. The FDLOADFONTFILE function's ppvView and pcjView parameters supply the location and size of each file's mapping, as returned by EngMapFontFileFD.

GDI unmaps the files when FDLOADFONTFILE returns. If the driver needs to remap the files later, in response to subsequent calls from GDI, it can call EngMapFontFileFD itself if it has saved the cFiles and piFile parameters.

When the GDI font engine calls the font driver's FDLOADFONTFILE DDI, it passes a checksum for the font in the ulFastCheckSum parameter. If this parameter is nonzero and the font in question has been cached, FDLOADFONTFILE can obtain a pointer to the font data with a call to EngFntCacheLookUp. After the font driver obtains the pointer to the font data, it can then load the font data. If the font has not been cached, the font driver can cache the font by first allocating memory for the font cache, using a call to EngFntCacheAlloc, and then writing the font data to that memory. If the font driver encounters an error reading or writing the font data, it can notify the GDI font engine by making a call to EngFntCacheFault.

If the GDI font engine called FDLOADFONTFILE and passed in a value of zero for the ulFastCheckSum parameter, this means that the GDI font engine is not in operation, and the font driver does not need to take any action.

Requirements

Header fontdrv.h
Windows Embedded CE Windows Embedded CE 6.0 R2

See Also

Reference

Pluggable Fonts Reference

Other Resources

Fonts Functions
Pluggable Fonts