Export (0) Print
Expand All
1 out of 1 rated this helpful - Rate this topic

EnumFontFamilies function

The EnumFontFamilies function enumerates the fonts in a specified font family that are available on a specified device.

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

Syntax


int EnumFontFamilies(
  _In_  HDC hdc,
  _In_  LPCTSTR lpszFamily,
  _In_  FONTENUMPROC lpEnumFontFamProc,
  _In_  LPARAM lParam
);

Parameters

hdc [in]

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

lpszFamily [in]

A pointer to a null-terminated string that specifies the family name of the desired fonts. If lpszFamily is NULL, EnumFontFamilies selects and enumerates one font of each available type family.

lpEnumFontFamProc [in]

A pointer to the application defined callback function. For information, see EnumFontFamProc.

lParam [in]

A pointer to application-supplied 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 implementation specific.

Remarks

For each font having the typeface name specified by the lpszFamily parameter, the EnumFontFamilies function retrieves information about that font and passes it to the function pointed to by the lpEnumFontFamProc parameter. The application defined callback function can process the font information as desired. Enumeration continues until there are no more fonts or the callback function returns zero.

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 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.

Examples

For examples, see Enumerating the Installed 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)

Library

Gdi32.lib

DLL

Gdi32.dll

Unicode and ANSI names

EnumFontFamiliesW (Unicode) and EnumFontFamiliesA (ANSI)

See also

Fonts and Text Overview
Font and Text Functions
EnumFonts
EnumFontFamiliesEx
EnumFontFamProc

 

 

Build date: 6/12/2013

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.