PySide.QtGui.QFontInfo class provides general information about fonts.
PySide.QtGui.QFontInfo class provides the same access functions as PySide.QtGui.QFont ,如 PySide.QtGui.QFontInfo.family() , PySide.QtGui.QFontInfo.pointSize() , PySide.QtGui.QFontInfo.italic() , PySide.QtGui.QFontInfo.weight() , PySide.QtGui.QFontInfo.fixedPitch() , PySide.QtGui.QFontInfo.styleHint() etc. But whilst the PySide.QtGui.QFont access functions return the values that were set, a PySide.QtGui.QFontInfo object returns the values that apply to the font that will actually be used to draw the text.
For example, when the program asks for a 25pt Courier font on a machine that has a non-scalable 24pt Courier font, PySide.QtGui.QFont will (normally) use the 24pt Courier for rendering. In this case, QFont.pointSize() returns 25 and QFontInfo.pointSize() returns 24.
There are three ways to create a PySide.QtGui.QFontInfo 对象。
| 参数: | arg__1 – PySide.QtGui.QFont |
|---|
Constructs a font info object for font .
The font must be screen-compatible, i.e. a font you use when drawing text in widgets or pixmaps , not PySide.QtGui.QPicture or PySide.QtGui.QPrinter .
The font info object holds the information for the font that is passed in the constructor at the time it is created, and is not updated if the font's attributes are changed later.
使用 QPainter.fontInfo() to get the font info when painting. This will give correct results also when painting on paint device that is not screen-compatible.
构造副本为 fi .
| 返回类型: | PySide.QtCore.bool |
|---|
返回 true 若 PySide.QtGui.QFontInfo.weight() would return a value greater than QFont.Normal ;否则返回 false。
| 返回类型: | PySide.QtCore.bool |
|---|
Returns true if the matched window system font is exactly the same as the one specified by the font; otherwise returns false.
另请参阅
| 返回类型: | unicode |
|---|
Returns the family name of the matched window system font.
另请参阅
| 返回类型: | PySide.QtCore.bool |
|---|
Returns the fixed pitch value of the matched window system font.
另请参阅
| 返回类型: | PySide.QtCore.bool |
|---|
Returns the italic value of the matched window system font.
另请参阅
| 返回类型: | PySide.QtCore.bool |
|---|
Returns the overline value of the matched window system font.
Here we read the overline flag directly from the PySide.QtGui.QFont . This is OK for X11 and for Windows because we always get what we want.
另请参阅
| 返回类型: | PySide.QtCore.int |
|---|
Returns the pixel size of the matched window system font.
另请参阅
| 返回类型: | PySide.QtCore.int |
|---|
Returns the point size of the matched window system font.
| 返回类型: | PySide.QtCore.qreal |
|---|
Returns the point size of the matched window system font.
另请参阅
| 返回类型: | PySide.QtCore.bool |
|---|
Returns true if the font is a raw mode font; otherwise returns false.
If it is a raw mode font, all other functions in PySide.QtGui.QFontInfo will return the same values set in the PySide.QtGui.QFont , regardless of the font actually used.
另请参阅
| 返回类型: | PySide.QtCore.bool |
|---|
Returns the strikeout value of the matched window system font.
This is OK for X11 and for Windows because we always get what we want.
另请参阅
| 返回类型: | PySide.QtGui.QFont.Style |
|---|
Returns the style value of the matched window system font.
另请参阅
| 返回类型: | PySide.QtGui.QFont.StyleHint |
|---|
Returns the style of the matched window system font.
Currently only returns the style hint set in PySide.QtGui.QFont .
另请参阅
QFont.styleHint() QFont.StyleHint
| 返回类型: | unicode |
|---|
Returns the style name of the matched window system font on system that supports it.
另请参阅
| 返回类型: | PySide.QtCore.bool |
|---|
Returns the underline value of the matched window system font.
Here we read the underline flag directly from the PySide.QtGui.QFont . This is OK for X11 and for Windows because we always get what we want.
另请参阅
| 返回类型: | PySide.QtCore.int |
|---|
Returns the weight of the matched window system font.