Share via


EnumFontsProc callback function

The EnumFontsProc function is an application definedcallback function that processes font data from the EnumFonts function. The FONTENUMPROC type defines a pointer to this callback function. EnumFontsProc 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 EnumFontsProc(
  _In_ const LOGFONT    *lplf,
  _In_ const TEXTMETRIC *lptm,
  _In_       DWORD      dwType,
  _In_       LPARAM     lpData
);

Parameters

lplf [in]

A pointer to a LOGFONT structure that contains information about the logical attributes of the font.

This can be an ENUMLOGFONTEXDV structure.

lptm [in]

A pointer to a TEXTMETRIC structure that contains information about the physical attributes of the font.

This can be an ENUMTEXTMETRIC structure.

dwType [in]

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

DEVICE_FONTTYPE

RASTER_FONTTYPE

TRUETYPE_FONTTYPE

lpData [in]

A pointer to the application-defined data passed by EnumFonts.

Return value

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

Remarks

The AND (&) operator can be used with the RASTER_FONTTYPE and DEVICE_FONTTYPE constants to determine the font type. The RASTER_FONTTYPE bit of the FontType parameter specifies whether the font is a raster or vector font. If the bit is one, the font is a raster font; if zero, it is a vector font. The DEVICE_FONTTYPE bit of FontType specifies whether the font is a device-based or graphics device interface (GDI)-based font. If the bit is one, the font is a device-based font; if zero, it is a GDI-based font.

If the device is capable of text transformations (scaling, italicizing, and so on) only the base font is enumerated. The user must inquire into the device's text-transformation abilities to determine which additional fonts are available directly from the device.

An application must register the EnumFontsProc function by passing its address to the EnumFonts function.

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

EnumFontsProcW (Unicode) and EnumFontsProcA (ANSI)

See also

Fonts and Text Overview

Font and Text Functions

EnumFonts

ENUMLOGFONTEXDV

ENUMTEXTMETRIC

LOGFONT

TEXTMETRIC