Freigeben über


EnumFontFamProc callback function

The EnumFontFamProc function is an application defined callback function used with the EnumFontFamilies function. It receives data describing the available fonts. The FONTENUMPROC type defines a pointer to this callback function. EnumFontFamProc is a placeholder for the application definedfunction name.

Note  This function is provided only for compatibility with 16-bit versions of Windows. Applications should call the EnumFontFamiliesEx function.

 

Syntax

int CALLBACK EnumFontFamProc(
  _In_ ENUMLOGFONT   *lpelf,
  _In_ NEWTEXTMETRIC *lpntm,
  _In_ DWORD         FontType,
  _In_ LPARAM        lParam
);

Parameters

lpelf [in]

A pointer to an ENUMLOGFONT structure that contains information about the logical attributes of the font. This structure is locally defined.

This can be an ENUMLOGFONTEXDV structure.

lpntm [in]

A 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 is a pointer to a TEXTMETRIC structure.

This can be an ENUMTEXTMETRIC structure.

FontType [in]

The type of the font. This parameter can be a combination of the following values:

DEVICE_FONTTYPE

RASTER_FONTTYPE

TRUETYPE_FONTTYPE

lParam [in]

A pointer to the application-defined data passed by the EnumFontFamilies function.

Return value

The return value must be a nonzero value to continue enumeration; to stop enumeration, it must return zero.

Remarks

An application must register this callback function by passing its address to the EnumFontFamilies function.

When the graphics mode on the device context is set to GM_ADVANCED using the SetGraphicsMode function and the DEVICE_FONTTYPE flag is passed to the FontType parameter, this function returns a list of type 1 and OpenType fonts on the system. When the graphics mode is not set to GM_ADVANCED, this function returns a list of type 1, OpenType, and TrueType fonts on the system.

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.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Wingdi.h (include Windows.h)

Unicode and ANSI names

EnumFontFamProcW (Unicode) and EnumFontFamProcA (ANSI)

See also

Fonts and Text Overview

Font and Text Functions

EnumFontFamilies

ENUMLOGFONT

ENUMLOGFONTEXDV

ENUMTEXTMETRIC

NEWTEXTMETRIC

TEXTMETRIC