CFont Class
Encapsulates a Windows graphics device interface (GDI) font and provides member functions for manipulating the font.
class CFont : public CGdiObject
Members
Public Constructors
Name |
Description |
---|---|
Constructs a CFont object. |
Public Methods
Name |
Description |
---|---|
Initializes a CFont with the specified characteristics. |
|
Initializes a CFont object with the characteristics given in a LOGFONT structure. |
|
Initializes a CFont with the specified height, measured in tenths of a point, and typeface. |
|
Same as CreateFontIndirect except that the font height is measured in tenths of a point rather than logical units. |
|
Returns a pointer to a CFont object when given a Windows HFONT. |
|
Fills a LOGFONT with information about the logical font attached to the CFont object. |
Public Operators
Name |
Description |
---|---|
Returns the Windows GDI font handle attached to the CFont object. |
Remarks
To use a CFont object, construct a CFont object and attach a Windows font to it with CreateFont, CreateFontIndirect, CreatePointFont, or CreatePointFontIndirect, and then use the object's member functions to manipulate the font.
The CreatePointFont and CreatePointFontIndirect functions are often easier to use than CreateFont or CreateFontIndirect since they do the conversion for the height of the font from a point size to logical units automatically.
For more information on CFont, see Graphic Objects.
Inheritance Hierarchy
CFont
Requirements
Header: afxwin.h