Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
EnumFonts

EnumFonts function

The EnumFonts function enumerates the fonts available on a specified device. For each font with the specified typeface name, the EnumFonts function retrieves information about that font and passes it to the application defined callback function. This callback function can process the font information as desired. Enumeration continues until there are no more fonts or the callback function returns zero.

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

Syntax


int EnumFonts(
  _In_ HDC          hdc,
  _In_ LPCTSTR      lpFaceName,
  _In_ FONTENUMPROC lpFontFunc,
  _In_ LPARAM       lParam
);

Parameters

hdc [in]

A handle to the device context from which to enumerate the fonts.

lpFaceName [in]

A pointer to a null-terminated string that specifies the typeface name of the desired fonts. If lpFaceName is NULL, EnumFonts randomly selects and enumerates one font of each available typeface.

lpFontFunc [in]

A pointer to the application definedcallback function. For more information, see EnumFontsProc.

lParam [in]

A pointer to any application-defined data. The data is passed to the callback function along with the font information.

Return value

The return value is the last value returned by the callback function. Its meaning is defined by the application.

Remarks

Use EnumFontFamiliesEx instead of EnumFonts. The EnumFontFamiliesEx function differs from the EnumFonts function in that it retrieves the style names associated with a TrueType font. With EnumFontFamiliesEx, you can retrieve information about font styles that cannot be enumerated using the EnumFonts function.

The fonts for many East Asian languages have two typeface names: an English name and a localized name. EnumFonts, EnumFontFamilies, and EnumFontFamiliesEx return the English typeface name if the system locale does not match the language of the font.

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)

Library

Gdi32.lib

DLL

Gdi32.dll

Unicode and ANSI names

EnumFontsW (Unicode) and EnumFontsA (ANSI)

See also

Fonts and Text Overview
Font and Text Functions
EnumFontFamilies
EnumFontFamiliesEx
EnumFontsProc
GetDeviceCaps

 

 

Community Additions

ADD
Show:
© 2015 Microsoft