Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This function enumerates the fonts available on a specified device. This function is provided for compatibility with early versions of the Windows SDK. Whenever possible, applications should use the EnumFontFamiliesfunction.

Syntax

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

Parameters

hdc

[in] Handle to the device context (DC).

lpFaceName

[in] Long pointer to a null-terminated string that specifies the typeface name of the desired fonts. If lpFaceNameis NULL, EnumFontsrandomly selects and enumerates one font of each available typeface.

lpFontFunc

[in] Long pointer to the application–defined callback function. For more information, see EnumFontsProc.

lParam

[in] Pointer to any application–defined data. EnumFontspasses the data to the callback function along with the font information.

Return Value

The return value is the last value returned by the callback function. The application defines the meaning of the return value.

Remarks

Use EnumFontFamiliesinstead of EnumFonts. The EnumFontFamiliesfunction differs from EnumFontsin that EnumFontFamiliesretrieves the style names associated with a TrueType font. With EnumFontFamilies, you can retrieve information about font styles that you cannot enumerate using the EnumFontsfunction.

Windows CE 2.0 and later support systems that use either TrueType or raster fonts, but not both. The OEM chooses the font type, raster or TrueType, at system design time, and an application cannot change the font type.

Windows CE 1.0 and 1.01 support only raster fonts.

Requirements

Header windows.h
Library coredll.lib
Windows Embedded CE Windows CE 1.0 and later
Windows Mobile Pocket PC for Windows Mobile Version 5.0 and later, Smartphone for Windows Mobile Version 5.0 and later

See Also