Home | Trees | Index | Help |
|
---|
Package wx :: Class Font |
|
object
--+ |Object
--+ |GDIObject
--+ | Font
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 wx.SystemSettings
.
The possible values for the family parameter of wx.Font constructor are:
wx.FONTFAMILY_DEFAULT Chooses a default font. wx.FONTFAMILY_DECORATIVE A decorative font. wx.FONTFAMILY_ROMAN A formal, serif font. wx.FONTFAMILY_SCRIPT A handwriting font. wx.FONTFAMILY_SWISS A sans-serif font. wx.FONTFAMILY_MODERN Usually a fixed pitch font. wx.FONTFAMILY_TELETYPE A teletype font.
The possible values for the weight parameter are:
wx.FONTWEIGHT_NORMAL wx.FONTWEIGHT_LIGHT wx.FONTWEIGHT_BOLD
The known font encodings are:
wx.FONTENCODING_SYSTEM system default wx.FONTENCODING_DEFAULT current default encoding wx.FONTENCODING_ISO8859_1 West European (Latin1) wx.FONTENCODING_ISO8859_2 Central and East European (Latin2) wx.FONTENCODING_ISO8859_3 Esperanto (Latin3) wx.FONTENCODING_ISO8859_4 Baltic (old) (Latin4) wx.FONTENCODING_ISO8859_5 Cyrillic wx.FONTENCODING_ISO8859_6 Arabic wx.FONTENCODING_ISO8859_7 Greek wx.FONTENCODING_ISO8859_8 Hebrew wx.FONTENCODING_ISO8859_9 Turkish (Latin5) wx.FONTENCODING_ISO8859_10 Variation of Latin4 (Latin6) wx.FONTENCODING_ISO8859_11 Thai wx.FONTENCODING_ISO8859_12 doesn't exist currently, but put it here anyhow to make all ISO8859 consecutive numbers wx.FONTENCODING_ISO8859_13 Baltic (Latin7) wx.FONTENCODING_ISO8859_14 Latin8 wx.FONTENCODING_ISO8859_15 Latin9 (a.k.a. Latin0, includes euro) wx.FONTENCODING_KOI8 Cyrillic charset wx.FONTENCODING_ALTERNATIVE same as MS-DOS CP866 wx.FONTENCODING_BULGARIAN used under Linux in Bulgaria wx.FONTENCODING_CP437 original MS-DOS codepage wx.FONTENCODING_CP850 CP437 merged with Latin1 wx.FONTENCODING_CP852 CP437 merged with Latin2 wx.FONTENCODING_CP855 another cyrillic encoding wx.FONTENCODING_CP866 and another one wx.FONTENCODING_CP874 WinThai wx.FONTENCODING_CP1250 WinLatin2 wx.FONTENCODING_CP1251 WinCyrillic wx.FONTENCODING_CP1252 WinLatin1 wx.FONTENCODING_CP1253 WinGreek (8859-7) wx.FONTENCODING_CP1254 WinTurkish wx.FONTENCODING_CP1255 WinHebrew wx.FONTENCODING_CP1256 WinArabic wx.FONTENCODING_CP1257 WinBaltic (same as Latin 7) wx.FONTENCODING_UTF7 UTF-7 Unicode encoding wx.FONTENCODING_UTF8 UTF-8 Unicode encoding
Method Summary | |
---|---|
Font |
Creates a font object with the specified attributes. |
__del__(self)
| |
bool | __eq__(self,
other)
|
bool | __ne__(self,
other)
|
__nonzero__(self)
| |
int |
Returns the encoding used for all fonts created with an encoding of wx.FONTENCODING_DEFAULT. (Static method) |
int |
Get the font's encoding. |
String |
Returns the typeface name associated with the font, or the empty string if there is no typeface information. |
int |
Gets the font family. |
String |
Returns a string representation of the font family. |
NativeFontInfo |
Constructs a wx.NativeFontInfo object from this font. |
String |
Returns the platform-dependent string completely describing this font or an empty string if the font isn't valid. |
String |
Returns a human readable version of GetNativeFontInfoDesc . |
bool | GetNoAntiAliasing(self)
|
Size |
Returns the size in pixels if the font was constructed with a pixel size. |
int |
Gets the point size. |
int |
Gets the font style. |
String |
Returns a string representation of the font style. |
bool |
Returns True if the font is underlined, False otherwise. |
int |
Gets the font weight. |
String |
Return a string representation of the font weight. |
bool |
Returns true if the font is a fixed width (or monospaced) font, false if it is a proportional one or font is invalid. |
bool |
Returns True if this font was successfully created. |
bool |
Returns True if the font is using a pixelSize. |
bool |
Returns True if this font was successfully created. |
Sets the default font encoding. (Static method) | |
Set the font encoding. | |
bool |
Sets the facename for the font. |
Sets the font family. | |
Set the font's attributes from a wx.NativeFontInfo object. | |
bool |
Set the font's attributes from string representation of a wx.NativeFontInfo object. |
bool |
Set the font's attributes from a string formerly returned from GetNativeFontInfoDesc . |
SetNoAntiAliasing(self,
no)
| |
Sets the size in pixels rather than points. | |
Sets the point size. | |
Sets the font style. | |
Sets underlining. | |
Sets the font weight. |
Property Summary | |
---|---|
Encoding : See GetEncoding and SetEncoding | |
FaceName : See GetFaceName and SetFaceName | |
Family : See GetFamily and SetFamily | |
FamilyString : See GetFamilyString | |
NativeFontInfo : See GetNativeFontInfo and SetNativeFontInfo | |
NativeFontInfoDesc : See GetNativeFontInfoDesc | |
NativeFontInfoUserDesc : See GetNativeFontInfoUserDesc and SetNativeFontInfoUserDesc | |
NoAntiAliasing : See GetNoAntiAliasing and SetNoAntiAliasing | |
PixelSize : See GetPixelSize and SetPixelSize | |
PointSize : See GetPointSize and SetPointSize | |
Style : See GetStyle and SetStyle | |
StyleString : See GetStyleString | |
thisown : The membership flag | |
Underlined : See GetUnderlined and SetUnderlined | |
Weight : See GetWeight and SetWeight | |
WeightString : See GetWeightString |
Instance Method Details |
---|
__init__(self,
pointSize,
family,
style,
weight,
underline=False,
face=EmptyString,
encoding=FONTENCODING_DEFAULT)
|
GetEncoding(self)Get the font's encoding.
|
GetFaceName(self)Returns the typeface name associated with the font, or the empty string if there is no typeface information.
|
GetFamily(self)Gets the font family.
|
GetFamilyString(self)Returns a string representation of the font family.
|
GetNativeFontInfo(self)Constructs a
|
GetNativeFontInfoDesc(self)Returns the platform-dependent string completely describing this font or an empty string if the font isn't valid.
|
GetNativeFontInfoUserDesc(self)Returns a human readable version of
|
GetPixelSize(self)Returns the size in pixels if the font was constructed with a pixel size.
|
GetPointSize(self)Gets the point size.
|
GetStyle(self)Gets the font style.
|
GetStyleString(self)Returns a string representation of the font style.
|
GetUnderlined(self)Returns True if the font is underlined, False otherwise.
|
GetWeight(self)Gets the font weight.
|
GetWeightString(self)Return a string representation of the font weight.
|
IsFixedWidth(self)Returns true if the font is a fixed width (or monospaced) font, false if it is a proportional one or font is invalid.
|
IsOk(self)Returns True if this font was successfully created.
|
IsUsingSizeInPixels(self)Returns True if the font is using a pixelSize.
|
Ok(self)Returns True if this font was successfully created.
|
SetEncoding(self, encoding)Set the font encoding.
|
SetFaceName(self, faceName)Sets the facename for the font. The facename, which should be a valid font installed on the end-user's system. 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 family and the facename are specified, wxWidgets will first search for the specific face, and then for a font belonging to the same family.
|
SetFamily(self, family)Sets the font family.
|
SetNativeFontInfo(self, info)Set the font's attributes from a
|
SetNativeFontInfoFromString(self, info)Set the font's attributes from string representation of a
|
SetNativeFontInfoUserDesc(self, info)Set the font's attributes from a string formerly returned from
|
SetPixelSize(self, pixelSize)Sets the size in pixels rather than points. If there is platform API support for this then it is used, otherwise a font with the closest size is found using a binary search.
|
SetPointSize(self, pointSize)Sets the point size.
|
SetStyle(self, style)Sets the font style.
|
SetUnderlined(self, underlined)Sets underlining.
|
SetWeight(self, weight)Sets the font weight.
|
Static Method Details |
---|
GetDefaultEncoding()Returns the encoding used for all fonts created with an encoding of wx.FONTENCODING_DEFAULT.
|
SetDefaultEncoding(encoding)Sets the default font encoding.
|
Property Details |
---|
EncodingSee
|
FaceNameSee
|
Family |
FamilyStringSee
|
NativeFontInfoSee
|
NativeFontInfoDesc
|
NativeFontInfoUserDescSee
|
NoAntiAliasingSee
|
PixelSizeSee
|
PointSizeSee
|
Style |
StyleStringSee
|
thisownThe membership flag |
UnderlinedSee
|
Weight |
WeightStringSee
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1.20050511.rpd on Thu Mar 22 12:14:01 2007 | http://epydoc.sf.net |