Partager via


EnumFontFamProc

This function is an application-defined callback function that retrieves data that describes the available fonts.

int CALLBACK EnumFontFamProc(
  ENUMLOGFONT FAR* lpelf, 
  TEXTMETRIC FAR* lpntm, 
  DWORD FontType, 
  LPARAM lParam
);

Parameters

  • lpelf
    [in] Pointer to an ENUMLOGFONT structure that contains information about the logical attributes of the font. This structure is locally defined.
  • lpntm
    [in] 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] Integer that specifies the type of the font. The following table shows the possible values.
    Value Description
    DEVICE_FONTTYPE The device supports downloading TrueType fonts or the font is a device-resident font. DEVICE_FONTTYPE is not set 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.
    RASTER_FONTTYPE The font is a raster font. If neither RASTER_FONTTYPE nor TRUETYPE_FONTTYPE is set, the font is a vector font.
    TRUETYPE_FONTTYPE The font is a TrueType font. If neither RASTER_FONTTYPE nor TRUETYPE_FONTTYPE is set, the font is a vector font.
  • 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.

You can use the AND (&) operator with the RASTER_FONTTYPE, DEVICE_FONTTYPE, and TRUETYPE_FONTTYPE constants to determine the font type.

The physical attributes of the font are always contained in a TEXTMETRIC structure.

Windows CE 1.0 and 1.01 do not support TrueType fonts. In version 1.0, the value of the FontType parameter is always RASTER_FONTTYPE.

In Windows CE 2.0 and later, FontType can have a value of either RASTER_FONTTYPE or TRUETYPE_FONTTYPE, depending on the Windows CE-based platform. Any Windows CE-based platform supports only raster fonts or TrueType fonts, but not both. The OEM chooses the font type, raster or TrueType, at system design time, and the application cannot change the font type.

Requirements

OS Versions: Windows CE 1.0 and later.
Header: Windows.h.

See Also

EnumFontFamilies | EnumFonts | ENUMLOGFONT | NEWTEXTMETRIC | TEXTMETRIC

Last updated on Wednesday, April 13, 2005

© 2005 Microsoft Corporation. All rights reserved.