1998-05-20 14:25:30 +00:00
\section { \class { wxFont} } \label { wxfont}
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.
2003-05-06 07:53:46 +00:00
You can retrieve the current system font settings with \helpref { wxSystemSettings} { wxsystemsettings} .
\helpref { wxSystemSettings} { wxsystemsettings}
1998-05-20 14:25:30 +00:00
\wxheading { Derived from}
\helpref { wxGDIObject} { wxgdiobject} \\
\helpref { wxObject} { wxobject}
1999-02-15 20:41:29 +00:00
\wxheading { Include files}
<wx/font.h>
2001-05-31 20:27:37 +00:00
\wxheading { Constants}
2004-09-25 23:03:44 +00:00
The possible values for the \arg { family} parameter of \helpref { wxFont
2004-09-30 11:15:59 +00:00
constructor} { wxfontctor} are (the old names are for compatibility only):
2004-09-25 23:03:44 +00:00
\begin { verbatim}
enum wxFontFamily
{
wxFONTFAMILY_ DEFAULT = wxDEFAULT,
wxFONTFAMILY_ DECORATIVE = wxDECORATIVE,
wxFONTFAMILY_ ROMAN = wxROMAN,
wxFONTFAMILY_ SCRIPT = wxSCRIPT,
wxFONTFAMILY_ SWISS = wxSWISS,
wxFONTFAMILY_ MODERN = wxMODERN,
wxFONTFAMILY_ TELETYPE = wxTELETYPE,
wxFONTFAMILY_ MAX
} ;
\end { verbatim}
2005-04-13 13:53:19 +00:00
The possible values for the \arg { weight} parameter are (the old names
are for compatibility only):
\begin { verbatim}
enum wxFontWeight
{
wxFONTWEIGHT_ NORMAL = wxNORMAL,
wxFONTWEIGHT_ LIGHT = wxLIGHT,
wxFONTWEIGHT_ BOLD = wxBOLD,
wxFONTWEIGHT_ MAX
} ;
\end { verbatim}
2002-11-02 23:58:52 +00:00
The font flags which can be used during the font creation are:
2004-02-22 01:16:32 +00:00
2002-11-02 23:58:52 +00:00
\begin { verbatim}
enum
{
// no special flags: font with default weight/slant/anti-aliasing
wxFONTFLAG_ DEFAULT = 0,
// slant flags (default: no slant)
wxFONTFLAG_ ITALIC = 1 << 0,
wxFONTFLAG_ SLANT = 1 << 1,
// weight flags (default: medium)
wxFONTFLAG_ LIGHT = 1 << 2,
wxFONTFLAG_ BOLD = 1 << 3,
// anti-aliasing flag: force on or off (default: the current system default)
wxFONTFLAG_ ANTIALIASED = 1 << 4,
wxFONTFLAG_ NOT_ ANTIALIASED = 1 << 5,
// underlined/strikethrough flags (default: no lines)
wxFONTFLAG_ UNDERLINED = 1 << 6,
wxFONTFLAG_ STRIKETHROUGH = 1 << 7,
} ;
\end { verbatim}
The known font encodings are:
2004-02-22 01:16:32 +00:00
2001-05-31 20:27:37 +00:00
\begin { verbatim}
enum wxFontEncoding
{
wxFONTENCODING_ SYSTEM = -1, // system default
wxFONTENCODING_ DEFAULT, // current default encoding
// ISO8859 standard defines a number of single-byte charsets
wxFONTENCODING_ ISO8859_ 1, // West European (Latin1)
wxFONTENCODING_ ISO8859_ 2, // Central and East European (Latin2)
wxFONTENCODING_ ISO8859_ 3, // Esperanto (Latin3)
wxFONTENCODING_ ISO8859_ 4, // Baltic (old) (Latin4)
wxFONTENCODING_ ISO8859_ 5, // Cyrillic
wxFONTENCODING_ ISO8859_ 6, // Arabic
wxFONTENCODING_ ISO8859_ 7, // Greek
wxFONTENCODING_ ISO8859_ 8, // Hebrew
wxFONTENCODING_ ISO8859_ 9, // Turkish (Latin5)
wxFONTENCODING_ ISO8859_ 10, // Variation of Latin4 (Latin6)
wxFONTENCODING_ ISO8859_ 11, // Thai
wxFONTENCODING_ ISO8859_ 12, // doesn't exist currently, but put it
// here anyhow to make all ISO8859
// consecutive numbers
wxFONTENCODING_ ISO8859_ 13, // Baltic (Latin7)
wxFONTENCODING_ ISO8859_ 14, // Latin8
wxFONTENCODING_ ISO8859_ 15, // Latin9 (a.k.a. Latin0, includes euro)
wxFONTENCODING_ ISO8859_ MAX,
// Cyrillic charset soup (see http://czyborra.com/charsets/cyrillic.html)
wxFONTENCODING_ KOI8, // we don't support any of KOI8 variants
wxFONTENCODING_ ALTERNATIVE, // same as MS-DOS CP866
wxFONTENCODING_ BULGARIAN, // used under Linux in Bulgaria
// what would we do without Microsoft? They have their own encodings
// for DOS
wxFONTENCODING_ CP437, // original MS-DOS codepage
wxFONTENCODING_ CP850, // CP437 merged with Latin1
wxFONTENCODING_ CP852, // CP437 merged with Latin2
wxFONTENCODING_ CP855, // another cyrillic encoding
wxFONTENCODING_ CP866, // and another one
// and for Windows
wxFONTENCODING_ CP874, // WinThai
wxFONTENCODING_ CP1250, // WinLatin2
wxFONTENCODING_ CP1251, // WinCyrillic
wxFONTENCODING_ CP1252, // WinLatin1
wxFONTENCODING_ CP1253, // WinGreek (8859-7)
wxFONTENCODING_ CP1254, // WinTurkish
wxFONTENCODING_ CP1255, // WinHebrew
wxFONTENCODING_ CP1256, // WinArabic
wxFONTENCODING_ CP1257, // WinBaltic (same as Latin 7)
wxFONTENCODING_ CP12_ MAX,
wxFONTENCODING_ UTF7, // UTF-7 Unicode encoding
wxFONTENCODING_ UTF8, // UTF-8 Unicode encoding
wxFONTENCODING_ UNICODE, // Unicode - currently used only by
// wxEncodingConverter class
wxFONTENCODING_ MAX
} ;
\end { verbatim}
1999-03-01 13:06:15 +00:00
\wxheading { Predefined objects}
Objects:
{ \bf wxNullFont}
Pointers:
{ \bf wxNORMAL\_ FONT\\
wxSMALL\_ FONT\\
wxITALIC\_ FONT\\
wxSWISS\_ FONT}
1998-05-20 14:25:30 +00:00
\wxheading { See also}
\helpref { wxFont overview} { wxfontoverview} , \helpref { wxDC::SetFont} { wxdcsetfont} ,\rtfsp
\helpref { wxDC::DrawText} { wxdcdrawtext} , \helpref { wxDC::GetTextExtent} { wxdcgettextextent} ,\rtfsp
2003-05-06 07:53:46 +00:00
\helpref { wxFontDialog} { wxfontdialog} , \helpref { wxSystemSettings} { wxsystemsettings}
1998-05-20 14:25:30 +00:00
\latexignore { \rtfignore { \wxheading { Members} } }
2004-09-25 23:03:44 +00:00
2004-09-30 11:15:59 +00:00
\membersection { wxFont::wxFont} \label { wxfontctor}
1998-05-20 14:25:30 +00:00
\func { } { wxFont} { \void }
Default constructor.
2006-10-18 17:23:42 +00:00
\func { } { wxFont} { \param { const wxFont\& } { font} }
Copy constructor, uses \helpref { reference counting} { trefcount} .
2005-04-13 13:53:19 +00:00
\func { } { wxFont} { \param { int} { pointSize} , \param { wxFontFamily} { family} , \param { int} { style} , \param { wxFontWeight} { weight} ,
2004-09-25 23:03:44 +00:00
\param { const bool} { underline = false} , \param { const wxString\& } { faceName = ""} ,
\param { wxFontEncoding } { encoding = wxFONTENCODING\_ DEFAULT} }
2005-08-04 11:31:01 +00:00
\func { } { wxFont} { \param { const wxSize\& } { pixelSize} , \param { wxFontFamily} { family} , \param { int} { style} , \param { wxFontWeight} { weight} ,
2003-01-18 00:16:34 +00:00
\param { const bool} { underline = false} , \param { const wxString\& } { faceName = ""} ,
1999-09-29 19:02:07 +00:00
\param { wxFontEncoding } { encoding = wxFONTENCODING\_ DEFAULT} }
1998-05-20 14:25:30 +00:00
2004-09-25 23:03:44 +00:00
Creates a font object with the specified attributes.
1998-05-20 14:25:30 +00:00
\wxheading { Parameters}
\docparam { pointSize} { Size in points.}
2004-09-25 23:03:44 +00:00
\docparam { pixelSize} { Size in pixels: this is directly supported only under MSW
currently where this constructor can be used directly, under other platforms a
font with the closest size to the given one is found using binary search and
the static \helpref { New} { wxfontnew} method must be used.}
1998-05-20 14:25:30 +00:00
\docparam { family} { Font family, a generic way of referring to fonts without specifying actual facename. One of:
\twocolwidtha { 5cm}
\begin { twocollist} \itemsep =0pt
2005-04-13 13:53:19 +00:00
\twocolitem { { \bf wxFONTFAMILY\_ DEFAULT} } { Chooses a default font.}
\twocolitem { { \bf wxFONTFAMILY\_ DECORATIVE} } { A decorative font.}
\twocolitem { { \bf wxFONTFAMILY\_ ROMAN} } { A formal, serif font.}
\twocolitem { { \bf wxFONTFAMILY\_ SCRIPT} } { A handwriting font.}
\twocolitem { { \bf wxFONTFAMILY\_ SWISS} } { A sans-serif font.}
\twocolitem { { \bf wxFONTFAMILY\_ MODERN} } { A fixed pitch font.}
\twocolitem { { \bf wxFONTFAMILY\_ TELETYPE} } { A teletype font.}
1998-05-20 14:25:30 +00:00
\end { twocollist} }
2005-04-13 13:53:19 +00:00
\docparam { style} { One of { \bf wxFONTSTYLE\_ NORMAL} , { \bf wxFONTSTYLE\_ SLANT} and { \bf wxFONTSTYLE\_ ITALIC} .}
\docparam { weight} { Font weight, sometimes also referred to as font boldness. One of:
1998-05-20 14:25:30 +00:00
2005-04-13 13:53:19 +00:00
\twocolwidtha { 5cm}
\begin { twocollist} \itemsep =0pt
\twocolitem { { \bf wxFONTWEIGHT\_ NORMAL} } { Normal font.}
\twocolitem { { \bf wxFONTWEIGHT\_ LIGHT} } { Light font.}
\twocolitem { { \bf wxFONTWEIGHT\_ BOLD} } { Bold font.}
\end { twocollist} }
1998-05-20 14:25:30 +00:00
2003-03-05 20:15:35 +00:00
\docparam { underline} { The value can be true or false. At present this has an effect on Windows and Motif 2.x only.}
1998-05-20 14:25:30 +00:00
2004-12-11 21:33:17 +00:00
\docparam { faceName} { An optional string specifying the actual typeface to be used. If it is an empty string,
a default typeface will be chosen based on the family.}
1998-05-20 14:25:30 +00:00
1999-09-29 19:02:07 +00:00
\docparam { encoding} { An encoding which may be one of
\twocolwidtha { 5cm}
\begin { twocollist} \itemsep =0pt
\twocolitem { { \bf wxFONTENCODING\_ SYSTEM} } { Default system encoding.}
\twocolitem { { \bf wxFONTENCODING\_ DEFAULT} } { Default application encoding: this
2005-04-13 13:53:19 +00:00
is the encoding set by calls to
1999-10-22 13:12:08 +00:00
\helpref { SetDefaultEncoding} { wxfontsetdefaultencoding} and which may be set to,
1999-09-29 19:02:07 +00:00
say, KOI8 to create all fonts by default with KOI8 encoding. Initially, the
default application encoding is the same as default system encoding.}
\twocolitem { { \bf wxFONTENCODING\_ ISO8859\_ 1...15} } { ISO8859 encodings.}
2002-06-07 20:15:28 +00:00
\twocolitem { { \bf wxFONTENCODING\_ KOI8} } { The standard Russian encoding for Internet.}
1999-09-29 19:02:07 +00:00
\twocolitem { { \bf wxFONTENCODING\_ CP1250...1252} } { Windows encodings similar to ISO8859 (but not identical).}
\end { twocollist}
2004-09-25 23:03:44 +00:00
If the specified encoding isn't available, no font is created
(see also \helpref { font encoding overview} { wxfontencodingoverview} ).
1999-09-29 19:02:07 +00:00
}
1998-05-20 14:25:30 +00:00
\wxheading { Remarks}
If the desired font does not exist, the closest match will be chosen.
2002-06-07 20:15:28 +00:00
Under Windows, only scalable TrueType fonts are used.
1998-05-20 14:25:30 +00:00
See also \helpref { wxDC::SetFont} { wxdcsetfont} , \helpref { wxDC::DrawText} { wxdcdrawtext}
and \helpref { wxDC::GetTextExtent} { wxdcgettextextent} .
2004-09-25 23:03:44 +00:00
2004-09-30 11:15:59 +00:00
\membersection { wxFont::\destruct { wxFont} } \label { wxfontdtor}
1998-05-20 14:25:30 +00:00
\func { } { \destruct { wxFont} } { \void }
Destructor.
\wxheading { Remarks}
The destructor may not delete the underlying font object of the native windowing
1999-11-03 23:51:07 +00:00
system, since wxFont uses a reference counting system for efficiency.
1998-05-20 14:25:30 +00:00
Although all remaining fonts are deleted when the application exits,
the application should try to clean up all fonts itself. This is because
2004-05-04 08:27:20 +00:00
wxWidgets cannot know if a pointer to the font object is stored in an
1998-05-20 14:25:30 +00:00
application data structure, and there is a risk of double deletion.
2004-09-25 23:03:44 +00:00
2002-01-14 19:04:35 +00:00
\membersection { wxFont::IsFixedWidth} \label { wxfontisfixedwidth}
\constfunc { bool} { IsFixedWidth} { \void }
2005-04-13 13:53:19 +00:00
Returns { \tt true} if the font is a fixed width (or monospaced) font,
2003-01-18 00:16:34 +00:00
{ \tt false} if it is a proportional one or font is invalid.
2002-01-14 19:04:35 +00:00
2004-09-25 23:03:44 +00:00
1999-11-03 23:51:07 +00:00
\membersection { wxFont::GetDefaultEncoding} \label { wxfontgetdefaultencoding}
\func { static wxFontEncoding} { GetDefaultEncoding} { \void }
2002-12-04 14:11:26 +00:00
Returns the current application's default encoding.
1999-11-03 23:51:07 +00:00
\wxheading { See also}
2005-04-13 13:53:19 +00:00
\helpref { Font encoding overview} { wxfontencodingoverview} ,
1999-11-03 23:51:07 +00:00
\helpref { SetDefaultEncoding} { wxfontsetdefaultencoding}
2004-09-25 23:03:44 +00:00
1998-05-20 14:25:30 +00:00
\membersection { wxFont::GetFaceName} \label { wxfontgetfacename}
\constfunc { wxString} { GetFaceName} { \void }
Returns the typeface name associated with the font, or the empty string if there is no
typeface information.
\wxheading { See also}
\helpref { wxFont::SetFaceName} { wxfontsetfacename}
2004-09-25 23:03:44 +00:00
1998-05-20 14:25:30 +00:00
\membersection { wxFont::GetFamily} \label { wxfontgetfamily}
2005-04-13 13:53:19 +00:00
\constfunc { wxFontFamily} { GetFamily} { \void }
1998-05-20 14:25:30 +00:00
2005-04-13 13:53:19 +00:00
Gets the font family. See \helpref { wxFont::SetFamily} { wxfontsetfamily} for a list of valid
1998-05-20 14:25:30 +00:00
family identifiers.
\wxheading { See also}
\helpref { wxFont::SetFamily} { wxfontsetfamily}
2004-09-25 23:03:44 +00:00
2001-12-21 17:39:13 +00:00
\membersection { wxFont::GetNativeFontInfoDesc} \label { wxfontgetnativefontinfodesc}
1998-05-20 14:25:30 +00:00
2001-12-21 17:39:13 +00:00
\constfunc { wxString} { GetNativeFontInfoDesc} { \void }
1998-05-20 14:25:30 +00:00
2006-05-29 00:03:36 +00:00
Returns the platform-dependent string completely describing this font.
Returned string is always non-empty.
2006-05-06 20:15:06 +00:00
Note that the returned string is not meant to be shown or edited by the user: a typical
use of this function is for serializing in string-form a wxFont object.
2001-12-21 17:39:13 +00:00
\wxheading { See also}
2006-05-06 20:15:06 +00:00
\helpref { wxFont::SetNativeFontInfo} { wxfontsetnativefontinfo} ,\helpref { wxFont::GetNativeFontInfoUserDesc} { wxfontgetnativefontinfouserdesc}
\membersection { wxFont::GetNativeFontInfoUserDesc} \label { wxfontgetnativefontinfouserdesc}
\func { wxString} { GetNativeFontInfoUserDesc} { \void }
2006-05-29 00:03:36 +00:00
Returns a user-friendly string for this font object. Returned string is always non-empty.
Some examples of the formats of returned strings (which are platform-dependent) are in \helpref { SetNativeFontInfoUserDesc} { wxfontsetnativefontinfouserdesc} .
2006-05-06 20:15:06 +00:00
\wxheading { See also}
\helpref { wxFont::GetNativeFontInfoDesc} { wxfontgetnativefontinfodesc}
1998-05-20 14:25:30 +00:00
2004-09-25 23:03:44 +00:00
1998-05-20 14:25:30 +00:00
\membersection { wxFont::GetPointSize} \label { wxfontgetpointsize}
\constfunc { int} { GetPointSize} { \void }
Gets the point size.
\wxheading { See also}
\helpref { wxFont::SetPointSize} { wxfontsetpointsize}
2004-09-25 23:03:44 +00:00
1998-05-20 14:25:30 +00:00
\membersection { wxFont::GetStyle} \label { wxfontgetstyle}
\constfunc { int} { GetStyle} { \void }
2004-09-30 11:15:59 +00:00
Gets the font style. See \helpref { wxFont::wxFont} { wxfontctor} for a list of valid
1998-05-20 14:25:30 +00:00
styles.
\wxheading { See also}
\helpref { wxFont::SetStyle} { wxfontsetstyle}
2004-09-25 23:03:44 +00:00
1998-05-20 14:25:30 +00:00
\membersection { wxFont::GetUnderlined} \label { wxfontgetunderlined}
\constfunc { bool} { GetUnderlined} { \void }
2003-01-18 00:16:34 +00:00
Returns true if the font is underlined, false otherwise.
1998-05-20 14:25:30 +00:00
\wxheading { See also}
\helpref { wxFont::SetUnderlined} { wxfontsetunderlined}
2004-09-25 23:03:44 +00:00
1998-05-20 14:25:30 +00:00
\membersection { wxFont::GetWeight} \label { wxfontgetweight}
2005-04-13 13:53:19 +00:00
\constfunc { wxFontWeight} { GetWeight} { \void }
1998-05-20 14:25:30 +00:00
2004-09-30 11:15:59 +00:00
Gets the font weight. See \helpref { wxFont::wxFont} { wxfontctor} for a list of valid
1998-05-20 14:25:30 +00:00
weight identifiers.
\wxheading { See also}
\helpref { wxFont::SetWeight} { wxfontsetweight}
2004-09-25 23:03:44 +00:00
\membersection { wxFont::New} \label { wxfontnew}
2005-04-13 13:53:19 +00:00
\func { static wxFont *} { New} { \param { int} { pointSize} , \param { wxFontFamily} { family} , \param { int} { style} , \param { wxFontWeight} { weight} ,
2004-09-25 23:03:44 +00:00
\param { const bool} { underline = false} , \param { const wxString\& } { faceName = ""} ,
\param { wxFontEncoding } { encoding = wxFONTENCODING\_ DEFAULT} }
2005-04-13 13:53:19 +00:00
\func { static wxFont *} { New} { \param { int} { pointSize} , \param { wxFontFamily} { family} ,
2004-09-25 23:03:44 +00:00
\param { int} { flags = \texttt { wxFONTFLAG\_ DEFAULT} } , \param { const wxString\& } { faceName = ""} ,
\param { wxFontEncoding } { encoding = wxFONTENCODING\_ DEFAULT} }
2005-04-13 13:53:19 +00:00
\func { static wxFont *} { New} { \param { const wxSize\& } { pixelSize} , \param { wxFontFamily} { family} , \param { int} { style} , \param { wxFontWeight} { weight} ,
2004-09-25 23:03:44 +00:00
\param { const bool} { underline = false} , \param { const wxString\& } { faceName = ""} ,
\param { wxFontEncoding } { encoding = wxFONTENCODING\_ DEFAULT} }
2005-04-13 13:53:19 +00:00
\func { static wxFont *} { New} { \param { const wxSize\& } { pixelSize} , \param { wxFontFamily} { family} ,
2004-09-25 23:03:44 +00:00
\param { int} { flags = \texttt { wxFONTFLAG\_ DEFAULT} } , \param { const wxString\& } { faceName = ""} ,
\param { wxFontEncoding } { encoding = wxFONTENCODING\_ DEFAULT} }
These functions take the same parameters as \helpref { wxFont
2004-09-30 11:15:59 +00:00
constructor} { wxfontctor} and return a new font object allocated on the heap.
2004-09-25 23:03:44 +00:00
Using \texttt { New()} is currently the only way to directly create a font with
the given size in pixels on platforms other than wxMSW.
2006-10-08 21:56:55 +00:00
\membersection { wxFont::IsOk} \label { wxfontisok}
2002-01-21 17:49:49 +00:00
2006-10-08 21:56:55 +00:00
\constfunc { bool} { IsOk} { \void }
2002-01-21 17:49:49 +00:00
2003-01-18 00:16:34 +00:00
Returns { \tt true} if this object is a valid font, { \tt false} otherwise.
2002-01-21 17:49:49 +00:00
2004-09-25 23:03:44 +00:00
1999-10-22 13:12:08 +00:00
\membersection { wxFont::SetDefaultEncoding} \label { wxfontsetdefaultencoding}
\func { static void} { SetDefaultEncoding} { \param { wxFontEncoding } { encoding} }
Sets the default font encoding.
1999-11-03 23:51:07 +00:00
\wxheading { See also}
2005-04-13 13:53:19 +00:00
\helpref { Font encoding overview} { wxfontencodingoverview} ,
1999-11-03 23:51:07 +00:00
\helpref { GetDefaultEncoding} { wxfontgetdefaultencoding}
2004-09-25 23:03:44 +00:00
1998-05-20 14:25:30 +00:00
\membersection { wxFont::SetFaceName} \label { wxfontsetfacename}
2006-05-29 00:03:36 +00:00
\func { bool} { SetFaceName} { \param { const wxString\& } { faceName} }
1998-05-20 14:25:30 +00:00
Sets the facename for the font.
2006-05-29 00:03:36 +00:00
Returns \true if the given face name exists; \false otherwise.
1998-05-20 14:25:30 +00:00
\wxheading { Parameters}
\docparam { faceName} { A valid facename, which should be on the end-user's system.}
\wxheading { Remarks}
To avoid portability problems, don't rely on a specific face, but specify the font family
instead or as well. A suitable font will be found on the end-user's system. If both the
2004-05-04 08:27:20 +00:00
family and the facename are specified, wxWidgets will first search for the specific face,
1998-05-20 14:25:30 +00:00
and then for a font belonging to the same family.
\wxheading { See also}
\helpref { wxFont::GetFaceName} { wxfontgetfacename} , \helpref { wxFont::SetFamily} { wxfontsetfamily}
2004-09-25 23:03:44 +00:00
1998-05-20 14:25:30 +00:00
\membersection { wxFont::SetFamily} \label { wxfontsetfamily}
2005-04-13 13:53:19 +00:00
\func { void} { SetFamily} { \param { wxFontFamily} { family} }
1998-05-20 14:25:30 +00:00
Sets the font family.
\wxheading { Parameters}
\docparam { family} { One of:
\twocolwidtha { 5cm}
\begin { twocollist} \itemsep =0pt
2005-04-13 13:53:19 +00:00
\twocolitem { { \bf wxFONTFAMILY\_ DEFAULT} } { Chooses a default font.}
\twocolitem { { \bf wxFONTFAMILY\_ DECORATIVE} } { A decorative font.}
\twocolitem { { \bf wxFONTFAMILY\_ ROMAN} } { A formal, serif font.}
\twocolitem { { \bf wxFONTFAMILY\_ SCRIPT} } { A handwriting font.}
\twocolitem { { \bf wxFONTFAMILY\_ SWISS} } { A sans-serif font.}
\twocolitem { { \bf wxFONTFAMILY\_ MODERN} } { A fixed pitch font.}
\twocolitem { { \bf wxFONTFAMILY\_ TELETYPE} } { A teletype font.}
1998-05-20 14:25:30 +00:00
\end { twocollist} }
\wxheading { See also}
\helpref { wxFont::GetFamily} { wxfontgetfamily} , \helpref { wxFont::SetFaceName} { wxfontsetfacename}
2004-09-25 23:03:44 +00:00
2001-12-21 17:39:13 +00:00
\membersection { wxFont::SetNativeFontInfo} \label { wxfontsetnativefontinfo}
2006-05-29 00:03:36 +00:00
\func { bool} { SetNativeFontInfo} { \param { const wxString\& } { info} }
2001-12-21 17:39:13 +00:00
2006-05-29 00:03:36 +00:00
Creates the font corresponding to the given native font description string and returns \true if
the creation was successful.
2005-04-13 13:53:19 +00:00
which must have been previously returned by
2001-12-21 17:39:13 +00:00
\helpref { GetNativeFontInfoDesc} { wxfontgetnativefontinfodesc} . If the string is
2006-05-06 20:15:06 +00:00
invalid, font is unchanged. This function is typically used for de-serializing a wxFont
object previously saved in a string-form.
\wxheading { See also}
\helpref { wxFont::SetNativeFontInfoUserDesc} { wxfontsetnativefontinfouserdesc}
\membersection { wxFont::SetNativeFontInfoUserDesc} \label { wxfontsetnativefontinfouserdesc}
2006-05-29 00:03:36 +00:00
\func { bool} { SetNativeFontInfoUserDesc} { \param { const wxString\& } { info} }
2006-05-06 20:15:06 +00:00
2006-05-29 00:03:36 +00:00
Creates the font corresponding to the given native font description string and returns \true if
the creation was successful.
2006-05-06 20:15:06 +00:00
Unlike \helpref { SetNativeFontInfo} { wxfontsetnativefontinfo} , this function accepts
strings which are user-friendly.
Examples of accepted string formats are:
\twocolwidtha { 15cm}
\begin { twocollist} \itemsep =0pt
\twocolitem { Generic syntax} { Example}
\twocolitem { on { \bf wxGTK2} : { \tt $ [ FACE - NAME ] $ $ [ bold ] $ $ [ oblique|italic ] $ $ [ POINTSIZE ] $ } } { Monospace bold 10}
\twocolitem { on { \bf wxMSW} : { \tt $ [ light|bold ] $ $ [ italic ] $ $ [ FACE - NAME ] $ $ [ POINTSIZE ] $ $ [ ENCODING ] $ } } { Tahoma 10 WINDOWS-1252}
\twocolitem { on { \bf wxMac} : FIXME} { FIXME}
\end { twocollist}
2006-05-28 09:12:42 +00:00
For more detailed information about the allowed syntaxes you can look at the documentation of the native API used for font-rendering (e.g. \urlref { pango\_ font\_ description\_ from\_ string} { http://developer.gnome.org/doc/API/2.0/pango/pango-Fonts.html\# pango-font-description-from-string} ).
2006-05-06 20:15:06 +00:00
\wxheading { See also}
\helpref { wxFont::SetNativeFontInfo} { wxfontsetnativefontinfo}
2001-12-21 17:39:13 +00:00
2004-09-25 23:03:44 +00:00
1998-05-20 14:25:30 +00:00
\membersection { wxFont::SetPointSize} \label { wxfontsetpointsize}
1998-06-14 12:11:50 +00:00
\func { void} { SetPointSize} { \param { int} { pointSize} }
1998-05-20 14:25:30 +00:00
Sets the point size.
\wxheading { Parameters}
\docparam { pointSize} { Size in points.}
\wxheading { See also}
\helpref { wxFont::GetPointSize} { wxfontgetpointsize}
2004-09-25 23:03:44 +00:00
1998-05-20 14:25:30 +00:00
\membersection { wxFont::SetStyle} \label { wxfontsetstyle}
1998-06-14 12:11:50 +00:00
\func { void} { SetStyle} { \param { int} { style} }
1998-05-20 14:25:30 +00:00
Sets the font style.
\wxheading { Parameters}
2005-04-13 13:53:19 +00:00
\docparam { style} { One of { \bf wxFONTSTYLE\_ NORMAL} , { \bf wxFONTSTYLE\_ SLANT} and { \bf wxFONTSTYLE\_ ITALIC} .}
1998-05-20 14:25:30 +00:00
\wxheading { See also}
\helpref { wxFont::GetStyle} { wxfontgetstyle}
2004-09-25 23:03:44 +00:00
1998-05-20 14:25:30 +00:00
\membersection { wxFont::SetUnderlined} \label { wxfontsetunderlined}
\func { void} { SetUnderlined} { \param { const bool} { underlined} }
Sets underlining.
\wxheading { Parameters}
2003-01-18 00:16:34 +00:00
\docparam { underlining} { true to underline, false otherwise.}
1998-05-20 14:25:30 +00:00
\wxheading { See also}
\helpref { wxFont::GetUnderlined} { wxfontgetunderlined}
2004-09-25 23:03:44 +00:00
1998-05-20 14:25:30 +00:00
\membersection { wxFont::SetWeight} \label { wxfontsetweight}
2005-04-13 13:53:19 +00:00
\func { void} { SetWeight} { \param { wxFontWeight} { weight} }
1998-05-20 14:25:30 +00:00
Sets the font weight.
\wxheading { Parameters}
2005-04-13 13:53:19 +00:00
\docparam { weight} { One of:
\twocolwidtha { 5cm}
\begin { twocollist} \itemsep =0pt
\twocolitem { { \bf wxFONTWEIGHT\_ NORMAL} } { Normal font.}
\twocolitem { { \bf wxFONTWEIGHT\_ LIGHT} } { Light font.}
\twocolitem { { \bf wxFONTWEIGHT\_ BOLD} } { Bold font.}
\end { twocollist} }
1998-05-20 14:25:30 +00:00
\wxheading { See also}
\helpref { wxFont::GetWeight} { wxfontgetweight}
2004-09-25 23:03:44 +00:00
1998-05-20 14:25:30 +00:00
\membersection { wxFont::operator $ = $ } \label { wxfontassignment}
\func { wxFont\& } { operator $ = $ } { \param { const wxFont\& } { font} }
2006-10-18 17:23:42 +00:00
Assignment operator, using \helpref { reference counting} { trefcount} .
1998-05-20 14:25:30 +00:00
2004-09-25 23:03:44 +00:00
1998-05-20 14:25:30 +00:00
\membersection { wxFont::operator $ = = $ } \label { wxfontequals}
\func { bool} { operator $ = = $ } { \param { 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,
2004-09-23 22:36:56 +00:00
so two independently-created fonts using the same parameters will
1998-05-20 14:25:30 +00:00
fail the test.
2004-09-25 23:03:44 +00:00
1998-05-20 14:25:30 +00:00
\membersection { wxFont::operator $ ! = $ } \label { wxfontnotequals}
\func { bool} { operator $ ! = $ } { \param { 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.