• PySide 模块
  • PySide.QtGui
  • 内容表

    上一话题

    QCursor

    下一话题

    QFontMetricsF

    QFontInfo

    详细描述

    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 对象。

    class PySide.QtGui. QFontInfo ( arg__1 )
    class PySide.QtGui. QFontInfo ( arg__1 )
    参数: 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.QtGui.QFontInfo. bold ( )
    返回类型: PySide.QtCore.bool

    返回 true 若 PySide.QtGui.QFontInfo.weight() would return a value greater than QFont.Normal ;否则返回 false。

    PySide.QtGui.QFontInfo. exactMatch ( )
    返回类型: 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.

    PySide.QtGui.QFontInfo. family ( )
    返回类型: unicode

    Returns the family name of the matched window system font.

    另请参阅

    QFont.family()

    PySide.QtGui.QFontInfo. fixedPitch ( )
    返回类型: PySide.QtCore.bool

    Returns the fixed pitch value of the matched window system font.

    PySide.QtGui.QFontInfo. italic ( )
    返回类型: PySide.QtCore.bool

    Returns the italic value of the matched window system font.

    另请参阅

    QFont.italic()

    PySide.QtGui.QFontInfo. overline ( )
    返回类型: 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.

    另请参阅

    QFont.overline()

    PySide.QtGui.QFontInfo. pixelSize ( )
    返回类型: PySide.QtCore.int

    Returns the pixel size of the matched window system font.

    另请参阅

    QFont.pointSize()

    PySide.QtGui.QFontInfo. pointSize ( )
    返回类型: PySide.QtCore.int

    Returns the point size of the matched window system font.

    PySide.QtGui.QFontInfo. pointSizeF ( )
    返回类型: PySide.QtCore.qreal

    Returns the point size of the matched window system font.

    PySide.QtGui.QFontInfo. rawMode ( )
    返回类型: 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.

    另请参阅

    QFont.rawMode()

    PySide.QtGui.QFontInfo. strikeOut ( )
    返回类型: 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.

    另请参阅

    QFont.strikeOut()

    PySide.QtGui.QFontInfo. style ( )
    返回类型: PySide.QtGui.QFont.Style

    Returns the style value of the matched window system font.

    另请参阅

    QFont.style()

    PySide.QtGui.QFontInfo. styleHint ( )
    返回类型: 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

    PySide.QtGui.QFontInfo. styleName ( )
    返回类型: unicode

    Returns the style name of the matched window system font on system that supports it.

    另请参阅

    QFont.styleName()

    PySide.QtGui.QFontInfo. underline ( )
    返回类型: 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.

    另请参阅

    QFont.underline()

    PySide.QtGui.QFontInfo. weight ( )
    返回类型: PySide.QtCore.int

    Returns the weight of the matched window system font.