This function is an application-defined callback function that retrieves data describing available fonts.
At a Glance
Header file: | Wingdi.h |
Windows CE versions: | 1.0 and later |
Syntax
int CALLBACK EnumFontFamProc(ENUMLOGFONT FAR *lpelf, TEXTMETRIC FAR *lpntm, int FontType, LPARAM lParam);
Parameters
lpelf
[out] Pointer to an ENUMLOGFONT structure that contains information about the logical attributes of the font. This structure is locally defined.
lpntm
[out] Pointer to a NEWTEXTMETRIC structure that contains information about the physical attributes of the font, if the font is a TrueType font. If the font is not a TrueType font, this parameter points to a TEXTMETRIC structure.
FontType
[in] Specifies the type of the font. This parameter can be a combination of the following values:
DEVICE_FONTTYPE |
RASTER_FONTTYPE |
TRUETYPE_FONTTYPE |
lParam
[in] Pointer to the application-defined data passed by the EnumFontFamilies function.
Return Values
Nonzero continues enumeration. Zero stops enumeration.
Remarks
An application must register this callback function by passing its address to the EnumFontFamilies function.
The AND (&) operator can be used with the RASTER_FONTTYPE, DEVICE_FONTTYPE, and TRUETYPE_FONTTYPE constants to determine the font type. If the RASTER_FONTTYPE bit is set, the font is a raster font. If the TRUETYPE_FONTTYPE bit is set, the font is a TrueType font. If neither bit is set, the font is a vector font. DEVICE_FONTTYPE is set when a device (for example, a laser printer) supports downloading TrueType fonts or when the font is a device-resident font; it is zero if the device is a display adapter, dot-matrix printer, or other raster device. An application can also use DEVICE_FONTTYPE to distinguish graphics device interface (GDI)-supplied raster fonts from device-supplied fonts. GDI can simulate bold, italic, underline, and strikeout attributes for GDI-supplied raster fonts, but not for device-supplied fonts.
The physical attributes of the font are always contained in a TEXTMETRIC structure.
Windows CE versions 1.0 and 1.01 does not support TrueType fonts. In version 1.0, the value of the FontType parameter will always be RASTER_FONTTYPE.
In Windows CE versions 2.0 and later, FontType can have a value of either RASTER_FONTTYPE or TRUETYPE_FONTTYPE depending on the Windows CE platform. Any Windows CE platform will support only raster fonts or TrueType fonts but not both. The font type (raster or TrueType) is chosen at system design time, and cannot be changed by an application.
See Also