Font class (gdiplusheaders.h)

The Font class encapsulates the characteristics, such as family, height, size, and style (or combination of styles), of a specific font. A Font object is used when drawing strings.

Inheritance

The Font class implements GdiplusBase.

Methods

The Font class has these methods.

 
Font::Clone

The Font::Clone method creates a new Font object based on this Font object.
Font::Font

This topic lists the constructors of the Font class. For a complete class listing, see Font Class. (overload 1/2)
Font::Font

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

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

This topic lists the constructors of the Font class. For a complete class listing, see Font Class. (overload 2/2)
Font::Font

Creates a Font::Font object based on the Windows Graphics Device Interface (GDI) font object that is currently selected into a specified device context. This constructor is provided for compatibility with GDI.
Font::Font

Creates a Font::Font object indirectly from a Windows Graphics Device Interface (GDI) logical font by using a handle to a GDILOGFONT structure.
Font::Font

Creates a Font::Font object directly from a Windows Graphics Device Interface (GDI) logical font. (overload 2/2)
Font::Font

Creates a Font::Font object directly from a Windows Graphics Device Interface (GDI) logical font. (overload 1/2)
Font::GetFamily

The Font::GetFamily method gets the font family on which this font is based.
Font::GetHeight

The Font::GetHeight method gets the line spacing of this font in the current unit of a specified Graphics object.
Font::GetHeight

The Font::GetHeight method gets the line spacing, in pixels, of this font.
Font::GetLastStatus

The Font::GetLastStatus method returns a value that indicates the nature of this Font object's most recent method failure.
Font::GetLogFontA

The Font::GetLogFontA method uses a LOGFONTA structure to get the attributes of this Font object.
Font::GetLogFontW

The Font::GetLogFontW method uses a LOGFONTW structure to get the attributes of this Font object.
Font::GetSize

The Font::GetSize method returns the font size (commonly called the em size) of this Font object. The size is in the units of this Font object.
Font::GetStyle

The Font::GetStyle method gets the style of this font's typeface.
Font::GetUnit

The Font::GetUnit method returns the unit of measure of this Font object.
Font::IsAvailable

The Font::IsAvailable method determines whether this Font object was created successfully.

Remarks

When using GDI+ API, you must never allow your application to download arbitrary fonts from untrusted sources. The operating system requires elevated privileges to assure that all installed fonts are trusted.

Requirements

Requirement Value
Target Platform Windows
Header gdiplusheaders.h