A font is an object which determines the appearance of text, primarily when drawing text to a canvas or device context. A font is determined by four parameters:
There is currently a difference between the appearance of fonts on the two platforms, if the mapping mode is anything other than MM_TEXT. Under X, font size is always specified in points. Under Windows, the unit for text is points but the text is scaled according to the current mapping mode. However, user scaling on a device canvas will also scale fonts under both environments. A future version of wxWindows will attempt to make font appearance more consistent across platforms.
wxFont::wxFont
voidwxFont
voidwxFontint point_size, int family, int style, int weight
Creates a font object. If the desired font does not exist, the closest match will be chosen. Under XView, this may result in a number of XView warnings during the matching process; these should be ignored, and will only occur the first time wxWindows attempts to use an absent font in a given size. wxWindows under Motif does the same thing, but silently. Under Windows 3, only scaleable TrueType fonts are used.
wxFont::wxFont
voidwxFont
Destroys a font object. Do not manually destroy a font which has been assigned to a canvas. All GDI objects, including fonts, are automatically destroyed on program exit, so there is no danger of memory leakage as in conventional Windows programming.
wxFont::GetPointSize
intGetPointSize
Gets the point size.