CreateFontIndirectExW function (wingdi.h)

The CreateFontIndirectEx function specifies a logical font that has the characteristics in the specified structure. The font can subsequently be selected as the current font for any device context.

Syntax

HFONT CreateFontIndirectExW(
  [in] const ENUMLOGFONTEXDVW *unnamedParam1
);

Parameters

[in] unnamedParam1

Pointer to an ENUMLOGFONTEXDV structure that defines the characteristics of a multiple master font.

Note, this function ignores the elfDesignVector member in ENUMLOGFONTEXDV.

Return value

If the function succeeds, the return value is the handle to the new ENUMLOGFONTEXDV structure.

If the function fails, the return value is zero. No extended error information is available.

Remarks

The CreateFontIndirectEx function creates a logical font with the characteristics specified in the ENUMLOGFONTEXDV structure. When this font is selected by using the SelectObject function, GDI's font mapper attempts to match the logical font with an existing physical font. If it fails to find an exact match, it provides an alternative whose characteristics match as many of the requested characteristics as possible.

When you no longer need the font, call the DeleteObject function to delete it.

The font mapper for CreateFont, CreateFontIndirect, and CreateFontIndirectEx recognizes both the English and the localized typeface name, regardless of locale.

Note

The wingdi.h header defines CreateFontIndirectEx as an alias that automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that is not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header wingdi.h (include Windows.h)
Library Gdi32.lib
DLL Gdi32.dll

See also

CreateFont

CreateFontIndirect

ENUMLOGFONTEXDV

EnumFontFamilies

EnumFontFamiliesEx

EnumFonts

Font and Text Functions

Fonts and Text Overview