Font::Font(constWCHAR*,REAL,INT,Unit,constFontCollection*) method (gdiplusheaders.h)

Creates a Font::Font object based on a font family, a size, a font style, a unit of measurement, and a FontCollection object.

Syntax

void Font(
  [in] const WCHAR          *familyName,
  [in] REAL                 emSize,
  [in] INT                  style,
  [in] Unit                 unit,
  [in] const FontCollection *fontCollection
);

Parameters

[in] familyName

Type: const WCHAR*

Name of the font family.

[in] emSize

Type: REAL

Real number that specifies the em size of the font measured in the units specified in the unit parameter.

[in] style

Type: INT

Optional. Integer that specifies the style of the typeface. This value must be an element of the FontStyle enumeration or the result of a bitwise OR applied to two or more of these elements. For example, FontStyleBold | FontStyleUnderline | FontStyleStrikeout sets the style as a combination of the three styles. The default value is FontStyleRegular.

[in] unit

Type: Unit

Optional. Element of the Unit enumeration that specifies the unit of measurement for the font size. The default value is UnitPoint.

[in] fontCollection

Type: const FontCollection*

Optional. Pointer to a FontCollection object that specifies a user-defined group of fonts. If the value of this parameter is NULL, the system font collection is used. The default value is NULL.

Return value

None

Requirements

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

See also

Font

FontFamily

FontStyle

Unit

Using Text and Fonts