.\" This is a wxWidgets manpage page generated from the XML docs .TH wxFont 3wx 2005-02-15 "wxWidgets" "wxWidgets class documentation" .SH NAME wxFont \- Represents fonts .SH DESCRIPTION A font is an object which determines the appearance of text. Fonts are used for drawing text to a device context, and setting the appearance of a window's text. You can retrieve the current system font settings with wxSystemSettings . wxSystemSettings .SH "PARENTS" wxGDIObject wxObject .SH "INCLUDE FILES" wx/font.h .SH MEMBERS .SS wxFont () Default constructor. .SS wxFont (int pointSizewxFontFamily familyint stylewxFontWeight weightconst bool underline = falseconst wxString& faceName = ""wxFontEncoding encoding = wxFONTENCODING_DEFAULT) .SS wxFont (const wxSize& pixelSizewxFontFamily familyint stylewxFontWeight weightconst bool underline = falseconst wxString& faceName = ""wxFontEncoding encoding = wxFONTENCODING_DEFAULT) Creates a font object with the specified attributes. .SS ~wxFont () Destructor. .SS bool IsFixedWidth () Returns true if the font is a fixed width (or monospaced) font, false if it is a proportional one or font is invalid. .SS static wxFontEncoding GetDefaultEncoding () Returns the current application's default encoding. .SS wxString GetFaceName () Returns the typeface name associated with the font, or the empty string if there is no typeface information. .SS wxFontFamily GetFamily () Gets the font family. See wxFont::SetFamily for a list of valid family identifiers. .SS wxString GetNativeFontInfoDesc () Returns the platform-dependent string completely describing this font or an empty string if the font wasn't constructed using the native font description. .SS int GetPointSize () Gets the point size. .SS int GetStyle () Gets the font style. See wxFont::wxFont for a list of valid styles. .SS bool GetUnderlined () Returns true if the font is underlined, false otherwise. .SS wxFontWeight GetWeight () Gets the font weight. See wxFont::wxFont for a list of valid weight identifiers. .SS static wxFont * New (int pointSizewxFontFamily familyint stylewxFontWeight weightconst bool underline = falseconst wxString& faceName = ""wxFontEncoding encoding = wxFONTENCODING_DEFAULT) .SS static wxFont * New (int pointSizewxFontFamily familyint flags = \texttt{wxFONTFLAG_DEFAULT}const wxString& faceName = ""wxFontEncoding encoding = wxFONTENCODING_DEFAULT) .SS static wxFont * New (const wxSize& pixelSizewxFontFamily familyint stylewxFontWeight weightconst bool underline = falseconst wxString& faceName = ""wxFontEncoding encoding = wxFONTENCODING_DEFAULT) .SS static wxFont * New (const wxSize& pixelSizewxFontFamily familyint flags = \texttt{wxFONTFLAG_DEFAULT}const wxString& faceName = ""wxFontEncoding encoding = wxFONTENCODING_DEFAULT) These functions take the same parameters as wxFont constructor and return a new font object allocated on the heap. Using New() is currently the only way to directly create a font with the given size in pixels on platforms other than wxMSW. .SS bool Ok () Returns true if this object is a valid font, false otherwise. .SS static void SetDefaultEncoding (wxFontEncoding encoding) Sets the default font encoding. .SS void SetFaceName (const wxString& faceName) .SS void SetFamily (wxFontFamily family) .SS void SetNativeFontInfo (const wxString& info) Creates the font corresponding to the given native font description string which must have been previously returned by GetNativeFontInfoDesc . If the string is invalid, font is unchanged. .SS void SetPointSize (int pointSize) Sets the point size. .SS void SetStyle (int style) Sets the font style. .SS void SetUnderlined (const bool underlined) Sets underlining. .SS void SetWeight (wxFontWeight weight) Sets the font weight. .SS wxFont& operator = (const wxFont& font) Assignment operator, using reference counting. Returns a reference to `this'. .SS bool operator == (const wxFont& font) Equality operator. Two fonts are equal if they contain pointers to the same underlying font data. It does not compare each attribute, so two independently-created fonts using the same parameters will fail the test. .SS bool operator != (const wxFont& font) Inequality operator. Two fonts are not equal if they contain pointers to different underlying font data. It does not compare each attribute. .SH "SEE ALSO" wxGDIObject wxObject wxFont overview wxDC::SetFont , wxDC::DrawText wxDC::GetTextExtent , wxFontDialog wxSystemSettings .SH "AUTHORS" Documentation content by Julian Smart, Robert Roebling, Vadim Zeitlin, Robin Dunn, et al Conversion to manpage format by Arnout Engelen (http://bzzt.net), bugreports welcome.