Version: 2.9.4
Public Member Functions | Static Public Member Functions
wxFont Class Reference

#include </home/zeitlin/src/wx/github/interface/wx/font.h>

Inheritance diagram for wxFont:

Detailed 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.

This class uses reference counting and copy-on-write internally so that assignments between two instances of this class are very cheap. You can therefore use actual objects instead of pointers without efficiency problems. If an instance of this class is changed it will create its own data internally so that other instances, which previously shared the data using the reference counting, are not affected.

You can retrieve the current system font settings with wxSystemSettings.

Library:  wxCore
Category:  Graphics Device Interface (GDI)

Predefined objects/pointers: wxNullFont, wxNORMAL_FONT, wxSMALL_FONT, wxITALIC_FONT, wxSWISS_FONT

参照:
wxFont Overview, wxDC::SetFont, wxDC::DrawText, wxDC::GetTextExtent, wxFontDialog, wxSystemSettings

Public Member Functions

 wxFont ()
 Default ctor.
 wxFont (const wxFont &font)
 Copy constructor, uses reference counting.
 wxFont (int pointSize, wxFontFamily family, wxFontStyle style, wxFontWeight weight, bool underline=false, const wxString &faceName=wxEmptyString, wxFontEncoding encoding=wxFONTENCODING_DEFAULT)
 Creates a font object with the specified attributes and size in points.
 wxFont (const wxSize &pixelSize, wxFontFamily family, wxFontStyle style, wxFontWeight weight, bool underline=false, const wxString &faceName=wxEmptyString, wxFontEncoding encoding=wxFONTENCODING_DEFAULT)
 Creates a font object with the specified attributes and size in pixels.
 wxFont (int pointSize, wxFontFamily family, int flags, const wxString &faceName=wxEmptyString, wxFontEncoding encoding=wxFONTENCODING_DEFAULT)
 Creates a font object using font flags.
 wxFont (const wxString &nativeInfoString)
 Constructor from font description string.
 wxFont (const wxNativeFontInfo &nativeInfo)
 Construct font from a native font info structure.
virtual ~wxFont ()
 Destructor.
bool operator!= (const wxFont &font) const
 Inequality operator.
bool operator== (const wxFont &font) const
 Equality operator.
wxFontoperator= (const wxFont &font)
 Assignment operator, using reference counting.
Getters
virtual wxFontEncoding GetEncoding () const
 Returns the encoding of this font.
virtual wxString GetFaceName () const
 Returns the face name associated with the font, or the empty string if there is no face information.
virtual wxFontFamily GetFamily () const
 Gets the font family if possible.
wxString GetNativeFontInfoDesc () const
 Returns the platform-dependent string completely describing this font.
wxString GetNativeFontInfoUserDesc () const
 Returns a user-friendly string for this font object.
const wxNativeFontInfoGetNativeFontInfo () const
 Returns the encoding of this font.
virtual int GetPointSize () const
 Gets the point size.
virtual wxSize GetPixelSize () const
 Gets the pixel size.
virtual wxFontStyle GetStyle () const
 Gets the font style.
virtual bool GetUnderlined () const
 Returns true if the font is underlined, false otherwise.
virtual bool GetStrikethrough () const
 Returns true if the font is stricken-through, false otherwise.
virtual wxFontWeight GetWeight () const
 Gets the font weight.
virtual bool IsFixedWidth () const
 Returns true if the font is a fixed width (or monospaced) font, false if it is a proportional one or font is invalid.
virtual bool IsOk () const
 Returns true if this object is a valid font, false otherwise.
Similar fonts creation

The functions in this section either modify the font in place or create a new font similar to the given one but with its weight, style or size changed.

wxFont Bold () const
 Returns a bold version of this font.
wxFont Italic () const
 Returns an italic version of this font.
wxFont Larger () const
 Returns a larger version of this font.
wxFont Smaller () const
 Returns a smaller version of this font.
wxFont Underlined () const
 Returns underlined version of this font.
wxFont Strikethrough () const
 Returns stricken-through version of this font.
wxFontMakeBold ()
 Changes this font to be bold.
wxFontMakeItalic ()
 Changes this font to be italic.
wxFontMakeLarger ()
 Changes this font to be larger.
wxFontMakeSmaller ()
 Changes this font to be smaller.
wxFontMakeUnderlined ()
 Changes this font to be underlined.
wxFontMakeStrikethrough ()
 Changes this font to be stricken-through.
wxFontScale (float x)
 Changes the size of this font.
wxFont Scaled (float x) const
 Returns a scaled version of this font.
Setters

These functions internally recreate the native font object with the new specified property.

virtual void SetEncoding (wxFontEncoding encoding)
 Sets the encoding for this font.
virtual bool SetFaceName (const wxString &faceName)
 Sets the facename for the font.
virtual void SetFamily (wxFontFamily family)
 Sets the font family.
bool SetNativeFontInfo (const wxString &info)
 Creates the font corresponding to the given native font description string which must have been previously returned by GetNativeFontInfoDesc().
bool SetNativeFontInfoUserDesc (const wxString &info)
 Creates the font corresponding to the given native font description string and returns true if the creation was successful.
void SetNativeFontInfo (const wxNativeFontInfo &info)
 Sets the encoding for this font.
virtual void SetPointSize (int pointSize)
 Sets the point size.
virtual void SetPixelSize (const wxSize &pixelSize)
 Sets the pixel size.
virtual void SetStyle (wxFontStyle style)
 Sets the font style.
void SetSymbolicSize (wxFontSymbolicSize size)
 Sets the font size using a predefined symbolic size name.
void SetSymbolicSizeRelativeTo (wxFontSymbolicSize size, int base)
 Sets the font size compared to the base font size.
virtual void SetUnderlined (bool underlined)
 Sets underlining.
virtual void SetStrikethrough (bool strikethrough)
 Sets strike-through attribute of the font.
virtual void SetWeight (wxFontWeight weight)
 Sets the font weight.

Static Public Member Functions

static wxFontEncoding GetDefaultEncoding ()
 Returns the current application's default encoding.
static void SetDefaultEncoding (wxFontEncoding encoding)
 Sets the default font encoding.
static wxFontNew (int pointSize, wxFontFamily family, wxFontStyle style, wxFontWeight weight, bool underline=false, const wxString &faceName=wxEmptyString, wxFontEncoding encoding=wxFONTENCODING_DEFAULT)
 This function takes the same parameters as the relative wxFont constructor and returns a new font object allocated on the heap.
static wxFontNew (int pointSize, wxFontFamily family, int flags=wxFONTFLAG_DEFAULT, const wxString &faceName=wxEmptyString, wxFontEncoding encoding=wxFONTENCODING_DEFAULT)
 This function takes the same parameters as the relative wxFont constructor and returns a new font object allocated on the heap.
static wxFontNew (const wxSize &pixelSize, wxFontFamily family, wxFontStyle style, wxFontWeight weight, bool underline=false, const wxString &faceName=wxEmptyString, wxFontEncoding encoding=wxFONTENCODING_DEFAULT)
 This function takes the same parameters as the relative wxFont constructor and returns a new font object allocated on the heap.
static wxFontNew (const wxSize &pixelSize, wxFontFamily family, int flags=wxFONTFLAG_DEFAULT, const wxString &faceName=wxEmptyString, wxFontEncoding encoding=wxFONTENCODING_DEFAULT)
 This function takes the same parameters as the relative wxFont constructor and returns a new font object allocated on the heap.
static wxFontNew (const wxNativeFontInfo &nativeInfo)
 This function takes the same parameters as the relative wxFont constructor and returns a new font object allocated on the heap.
static wxFontNew (const wxString &nativeInfoString)
 This function takes the same parameters as the relative wxFont constructor and returns a new font object allocated on the heap.

List of all members.


Constructor & Destructor Documentation

wxFont::wxFont ( )

Default ctor.

wxFont::wxFont ( const wxFont font)

Copy constructor, uses reference counting.

wxFont::wxFont ( int  pointSize,
wxFontFamily  family,
wxFontStyle  style,
wxFontWeight  weight,
bool  underline = false,
const wxString faceName = wxEmptyString,
wxFontEncoding  encoding = wxFONTENCODING_DEFAULT 
)

Creates a font object with the specified attributes and size in points.

Parameters:
pointSizeSize in points. See SetPointSize() for more info.
familyThe font family: a generic portable way of referring to fonts without specifying a facename. This parameter must be one of the wxFontFamily enumeration values. If the faceName argument is provided, then it overrides the font family.
styleOne of wxFONTSTYLE_NORMAL, wxFONTSTYLE_SLANT and wxFONTSTYLE_ITALIC.
weightFont weight, sometimes also referred to as font boldness. One of the wxFontWeight enumeration values.
underlineThe value can be true or false. At present this has an effect on Windows and Motif 2.x only.
faceNameAn optional string specifying the face name to be used. If it is an empty string, a default face name will be chosen based on the family.
encodingAn encoding which may be one of the enumeration values of wxFontEncoding. Briefly these can be summed up as:
wxFONTENCODING_SYSTEM Default system encoding.
wxFONTENCODING_DEFAULT Default application encoding: this is the encoding set by calls to SetDefaultEncoding() and which may be set to, say, KOI8 to create all fonts by default with KOI8 encoding. Initially, the default application encoding is the same as default system encoding.
wxFONTENCODING_ISO8859_1...15ISO8859 encodings.
wxFONTENCODING_KOI8 The standard Russian encoding for Internet.
wxFONTENCODING_CP1250...1252Windows encodings similar to ISO8859 (but not identical).
If the specified encoding isn't available, no font is created (see also Font Encodings).
注意:
If the desired font does not exist, the closest match will be chosen. Under Windows, only scalable TrueType fonts are used.
wxFont::wxFont ( const wxSize pixelSize,
wxFontFamily  family,
wxFontStyle  style,
wxFontWeight  weight,
bool  underline = false,
const wxString faceName = wxEmptyString,
wxFontEncoding  encoding = wxFONTENCODING_DEFAULT 
)

Creates a font object with the specified attributes and size in pixels.

Parameters:
pixelSizeSize in pixels. See SetPixelSize() for more info.
familyThe font family: a generic portable way of referring to fonts without specifying a facename. This parameter must be one of the wxFontFamily enumeration values. If the faceName argument is provided, then it overrides the font family.
styleOne of wxFONTSTYLE_NORMAL, wxFONTSTYLE_SLANT and wxFONTSTYLE_ITALIC.
weightFont weight, sometimes also referred to as font boldness. One of the wxFontWeight enumeration values.
underlineThe value can be true or false. At present this has an effect on Windows and Motif 2.x only.
faceNameAn optional string specifying the face name to be used. If it is an empty string, a default face name will be chosen based on the family.
encodingAn encoding which may be one of the enumeration values of wxFontEncoding. Briefly these can be summed up as:
wxFONTENCODING_SYSTEM Default system encoding.
wxFONTENCODING_DEFAULT Default application encoding: this is the encoding set by calls to SetDefaultEncoding() and which may be set to, say, KOI8 to create all fonts by default with KOI8 encoding. Initially, the default application encoding is the same as default system encoding.
wxFONTENCODING_ISO8859_1...15ISO8859 encodings.
wxFONTENCODING_KOI8 The standard Russian encoding for Internet.
wxFONTENCODING_CP1250...1252Windows encodings similar to ISO8859 (but not identical).
If the specified encoding isn't available, no font is created (see also Font Encodings).
注意:
If the desired font does not exist, the closest match will be chosen. Under Windows, only scalable TrueType fonts are used.
wxFont::wxFont ( int  pointSize,
wxFontFamily  family,
int  flags,
const wxString faceName = wxEmptyString,
wxFontEncoding  encoding = wxFONTENCODING_DEFAULT 
)

Creates a font object using font flags.

This constructor is similar to the constructors above except it specifies the font styles such as underlined, italic, bold, ... in a single flags argument instead of using separate arguments for them. This parameter can be a combination of wxFontFlag enum elements. The meaning of the remaining arguments is the same as in the other constructors, please see their documentation for details.

Notice that this constructor provides the only way of creating fonts with strike-through style.

Since:
2.9.4
wxFont::wxFont ( const wxString nativeInfoString)

Constructor from font description string.

This constructor uses SetNativeFontInfo() to initialize the font. If fontdesc is invalid the font remains uninitialized, i.e. its IsOk() method will return false.

wxFont::wxFont ( const wxNativeFontInfo nativeInfo)

Construct font from a native font info structure.

virtual wxFont::~wxFont ( ) [virtual]

Destructor.

See reference-counted object destruction for more info.

注意:
Although all remaining fonts are deleted when the application exits, the application should try to clean up all fonts itself. This is because wxWidgets cannot know if a pointer to the font object is stored in an application data structure, and there is a risk of double deletion.

Member Function Documentation

wxFont wxFont::Bold ( ) const

Returns a bold version of this font.

参照:
MakeBold()
Since:
2.9.1
static wxFontEncoding wxFont::GetDefaultEncoding ( ) [static]

Returns the current application's default encoding.

参照:
Font Encodings, SetDefaultEncoding()
virtual wxFontEncoding wxFont::GetEncoding ( ) const [virtual]

Returns the encoding of this font.

Note that under wxGTK the returned value is always wxFONTENCODING_UTF8.

参照:
SetEncoding()
virtual wxString wxFont::GetFaceName ( ) const [virtual]

Returns the face name associated with the font, or the empty string if there is no face information.

参照:
SetFaceName()
virtual wxFontFamily wxFont::GetFamily ( ) const [virtual]

Gets the font family if possible.

As described in wxFontFamily docs the returned value acts as a rough, basic classification of the main font properties (look, spacing).

If the current font face name is not recognized by wxFont or by the underlying system, wxFONTFAMILY_DEFAULT is returned.

Note that currently this function is not very precise and so not particularly useful. Font families mostly make sense only for font creation, see SetFamily().

参照:
SetFamily()
const wxNativeFontInfo* wxFont::GetNativeFontInfo ( ) const

Returns the encoding of this font.

Note that under wxGTK the returned value is always wxFONTENCODING_UTF8.

参照:
SetEncoding()
wxString wxFont::GetNativeFontInfoDesc ( ) const

Returns the platform-dependent string completely describing this font.

Returned string is always non-empty unless the font is invalid (in which case an assert is triggered).

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.

参照:
SetNativeFontInfo(), GetNativeFontInfoUserDesc()
wxString wxFont::GetNativeFontInfoUserDesc ( ) const

Returns a user-friendly string for this font object.

Returned string is always non-empty unless the font is invalid (in which case an assert is triggered).

The string does not encode all wxFont infos under all platforms; e.g. under wxMSW the font family is not present in the returned string.

Some examples of the formats of returned strings (which are platform-dependent) are in SetNativeFontInfoUserDesc().

参照:
SetNativeFontInfoUserDesc(), GetNativeFontInfoDesc()
virtual wxSize wxFont::GetPixelSize ( ) const [virtual]

Gets the pixel size.

Note that under wxMSW if you passed to SetPixelSize() (or to the ctor) a wxSize object with a null width value, you'll get a null width in the returned object.

参照:
SetPixelSize()
virtual int wxFont::GetPointSize ( ) const [virtual]

Gets the point size.

参照:
SetPointSize()
virtual bool wxFont::GetStrikethrough ( ) const [virtual]

Returns true if the font is stricken-through, false otherwise.

参照:
SetStrikethrough()
Since:
2.9.4
virtual wxFontStyle wxFont::GetStyle ( ) const [virtual]

Gets the font style.

See wxFontStyle for a list of valid styles.

参照:
SetStyle()
virtual bool wxFont::GetUnderlined ( ) const [virtual]

Returns true if the font is underlined, false otherwise.

参照:
SetUnderlined()
virtual wxFontWeight wxFont::GetWeight ( ) const [virtual]

Gets the font weight.

See wxFontWeight for a list of valid weight identifiers.

参照:
SetWeight()
virtual bool wxFont::IsFixedWidth ( ) const [virtual]

Returns true if the font is a fixed width (or monospaced) font, false if it is a proportional one or font is invalid.

Note that this function under some platforms is different than just testing for the font family being equal to wxFONTFAMILY_TELETYPE because native platform-specific functions are used for the check (resulting in a more accurate return value).

virtual bool wxFont::IsOk ( ) const [virtual]

Returns true if this object is a valid font, false otherwise.

wxFont wxFont::Italic ( ) const

Returns an italic version of this font.

参照:
MakeItalic()
Since:
2.9.1
wxFont wxFont::Larger ( ) const

Returns a larger version of this font.

The font size is multiplied by 1.2, the factor of 1.2 being inspired by the W3C CSS specification.

参照:
MakeLarger(), Smaller(), Scaled()
Since:
2.9.1
wxFont& wxFont::MakeBold ( )

Changes this font to be bold.

参照:
Bold()
Since:
2.9.1
wxFont& wxFont::MakeItalic ( )

Changes this font to be italic.

参照:
Italic()
Since:
2.9.1
wxFont& wxFont::MakeLarger ( )

Changes this font to be larger.

The font size is multiplied by 1.2, the factor of 1.2 being inspired by the W3C CSS specification.

参照:
Larger(), MakeSmaller(), Scale()
Since:
2.9.1
wxFont& wxFont::MakeSmaller ( )

Changes this font to be smaller.

The font size is divided by 1.2, the factor of 1.2 being inspired by the W3C CSS specification.

参照:
Smaller(), MakeLarger(), Scale()
Since:
2.9.1
wxFont& wxFont::MakeStrikethrough ( )

Changes this font to be stricken-through.

Currently stricken-through fonts are only supported in wxMSW and wxGTK.

参照:
Strikethrough()
Since:
2.9.4
wxFont& wxFont::MakeUnderlined ( )

Changes this font to be underlined.

参照:
Underlined()
Since:
2.9.2
static wxFont* wxFont::New ( const wxSize pixelSize,
wxFontFamily  family,
int  flags = wxFONTFLAG_DEFAULT,
const wxString faceName = wxEmptyString,
wxFontEncoding  encoding = wxFONTENCODING_DEFAULT 
) [static]

This function takes the same parameters as the relative wxFont constructor and returns a new font object allocated on the heap.

static wxFont* wxFont::New ( const wxString nativeInfoString) [static]

This function takes the same parameters as the relative wxFont constructor and returns a new font object allocated on the heap.

static wxFont* wxFont::New ( int  pointSize,
wxFontFamily  family,
wxFontStyle  style,
wxFontWeight  weight,
bool  underline = false,
const wxString faceName = wxEmptyString,
wxFontEncoding  encoding = wxFONTENCODING_DEFAULT 
) [static]

This function takes the same parameters as the relative wxFont constructor and returns a new font object allocated on the heap.

static wxFont* wxFont::New ( const wxSize pixelSize,
wxFontFamily  family,
wxFontStyle  style,
wxFontWeight  weight,
bool  underline = false,
const wxString faceName = wxEmptyString,
wxFontEncoding  encoding = wxFONTENCODING_DEFAULT 
) [static]

This function takes the same parameters as the relative wxFont constructor and returns a new font object allocated on the heap.

static wxFont* wxFont::New ( int  pointSize,
wxFontFamily  family,
int  flags = wxFONTFLAG_DEFAULT,
const wxString faceName = wxEmptyString,
wxFontEncoding  encoding = wxFONTENCODING_DEFAULT 
) [static]

This function takes the same parameters as the relative wxFont constructor and returns a new font object allocated on the heap.

static wxFont* wxFont::New ( const wxNativeFontInfo nativeInfo) [static]

This function takes the same parameters as the relative wxFont constructor and returns a new font object allocated on the heap.

bool wxFont::operator!= ( const wxFont font) const

Inequality operator.

See reference-counted object comparison for more info.

wxFont& wxFont::operator= ( const wxFont font)

Assignment operator, using reference counting.

bool wxFont::operator== ( const wxFont font) const

Equality operator.

See reference-counted object comparison for more info.

wxFont& wxFont::Scale ( float  x)

Changes the size of this font.

The font size is multiplied by the given factor (which may be less than 1 to create a smaller version of the font).

参照:
Scaled(), MakeLarger(), MakeSmaller()
Since:
2.9.1
wxFont wxFont::Scaled ( float  x) const

Returns a scaled version of this font.

The font size is multiplied by the given factor (which may be less than 1 to create a smaller version of the font).

参照:
Scale(), Larger(), Smaller()
Since:
2.9.1
static void wxFont::SetDefaultEncoding ( wxFontEncoding  encoding) [static]

Sets the default font encoding.

参照:
Font Encodings, GetDefaultEncoding()
virtual void wxFont::SetEncoding ( wxFontEncoding  encoding) [virtual]

Sets the encoding for this font.

Note that under wxGTK this function has no effect (because the underlying Pango library always uses wxFONTENCODING_UTF8).

参照:
GetEncoding()
virtual bool wxFont::SetFaceName ( const wxString faceName) [virtual]

Sets the facename for the font.

Parameters:
faceNameA valid facename, which should be on the end-user's system.
注意:
To avoid portability problems, don't rely on a specific face, but specify the font family instead (see wxFontFamily and SetFamily()).
Returns:
true if the given face name exists; if the face name doesn't exist in the user's system then the font is invalidated (so that IsOk() will return false) and false is returned.
参照:
GetFaceName(), SetFamily()
virtual void wxFont::SetFamily ( wxFontFamily  family) [virtual]

Sets the font family.

As described in wxFontFamily docs the given family value acts as a rough, basic indication of the main font properties (look, spacing).

Note that changing the font family results in changing the font face name.

Parameters:
familyOne of the wxFontFamily values.
参照:
GetFamily(), SetFaceName()
bool wxFont::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. This function is typically used for de-serializing a wxFont object previously saved in a string-form.

Returns:
true if the creation was successful.
参照:
SetNativeFontInfoUserDesc()
void wxFont::SetNativeFontInfo ( const wxNativeFontInfo info)

Sets the encoding for this font.

Note that under wxGTK this function has no effect (because the underlying Pango library always uses wxFONTENCODING_UTF8).

参照:
GetEncoding()
bool wxFont::SetNativeFontInfoUserDesc ( const wxString info)

Creates the font corresponding to the given native font description string and returns true if the creation was successful.

Unlike SetNativeFontInfo(), this function accepts strings which are user-friendly. Examples of accepted string formats are:

platform generic syntax example
wxGTK2 [FACE-NAME] [bold] [oblique|italic] [POINTSIZE] Monospace bold 10
wxMSW [light|bold] [italic] [FACE-NAME] [POINTSIZE] [ENCODING] Tahoma 10 WINDOWS-1252
Todo:
add an example for wxMac

For more detailed information about the allowed syntaxes you can look at the documentation of the native API used for font-rendering (e.g. pango_font_description_from_string on GTK).

Note that unlike SetNativeFontInfo(), this function doesn't always restore all attributes of the wxFont object under all platforms; e.g. on wxMSW the font family is not restored (because GetNativeFontInfoUserDesc doesn't return it on wxMSW). If you want to serialize/deserialize a font in string form, you should use GetNativeFontInfoDesc() and SetNativeFontInfo() instead.

参照:
SetNativeFontInfo()
virtual void wxFont::SetPixelSize ( const wxSize pixelSize) [virtual]

Sets the pixel size.

The height parameter of pixelSize must be positive while the width parameter may also be zero (to indicate that you're not interested in the width of the characters: a suitable width will be chosen for best rendering).

This feature (specifying the font pixel size) is directly supported only under wxMSW and wxGTK currently; under other platforms a font with the closest size to the given one is found using binary search (this maybe slower).

参照:
GetPixelSize()
virtual void wxFont::SetPointSize ( int  pointSize) [virtual]

Sets the point size.

The point size is defined as 1/72 of the anglo-Saxon inch (25.4 mm): it is approximately 0.0139 inch or 352.8 um.

Parameters:
pointSizeSize in points.
参照:
GetPointSize()
virtual void wxFont::SetStrikethrough ( bool  strikethrough) [virtual]

Sets strike-through attribute of the font.

Currently stricken-through fonts are only supported in wxMSW and wxGTK.

Parameters:
strikethroughtrue to add strike-through style, false to remove it.
参照:
GetStrikethrough()
Since:
2.9.4
virtual void wxFont::SetStyle ( wxFontStyle  style) [virtual]

Sets the font style.

Parameters:
styleOne of the wxFontStyle enumeration values.
参照:
GetStyle()
void wxFont::SetSymbolicSize ( wxFontSymbolicSize  size)

Sets the font size using a predefined symbolic size name.

This function allows to change font size to be (very) large or small compared to the standard font size.

参照:
SetSymbolicSizeRelativeTo().
Since:
2.9.2
void wxFont::SetSymbolicSizeRelativeTo ( wxFontSymbolicSize  size,
int  base 
)

Sets the font size compared to the base font size.

This is the same as SetSymbolicSize() except that it uses the given font size as the normal font size instead of the standard font size.

Since:
2.9.2
virtual void wxFont::SetUnderlined ( bool  underlined) [virtual]

Sets underlining.

Parameters:
underlinedtrue to underline, false otherwise.
参照:
GetUnderlined()
virtual void wxFont::SetWeight ( wxFontWeight  weight) [virtual]

Sets the font weight.

Parameters:
weightOne of the wxFontWeight values.
参照:
GetWeight()
wxFont wxFont::Smaller ( ) const

Returns a smaller version of this font.

The font size is divided by 1.2, the factor of 1.2 being inspired by the W3C CSS specification.

参照:
MakeSmaller(), Larger(), Scaled()
Since:
2.9.1
wxFont wxFont::Strikethrough ( ) const

Returns stricken-through version of this font.

Currently stricken-through fonts are only supported in wxMSW and wxGTK.

参照:
MakeStrikethrough()
Since:
2.9.4
wxFont wxFont::Underlined ( ) const

Returns underlined version of this font.

参照:
MakeUnderlined()
Since:
2.9.2
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines