Skip to content

PythonQt.QtGui.QFontInfo

QFontInfo

PythonQtInstanceWrapper object

Native bases: PythonQtInstanceWrapper

Supplemental documentation: Qt 5 reference:

Detailed Description

The QFontInfo class provides the same access functions as QFont, e.g. family(), pointSize(), italic(), weight(), fixedPitch(), styleHint() etc. But whilst the QFont access functions return the values that were set, a 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, 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 QFontInfo object.

  1. Calling the QFontInfo constructor with a QFont creates a font info object for a screen-compatible font, i.e. the font cannot be a printer font. If the font is changed later, the font info object is not updated.

(Note: If you use a printer font the values returned may be inaccurate. Printer fonts are not always accessible so the nearest screen font is used if a printer font is supplied.) 2. QWidget::fontInfo() returns the font info for a widget's font. This is equivalent to calling QFontInfo(widget->font()). If the widget's font is changed later, the font info object is not updated. 3. QPainter::fontInfo() returns the font info for a painter's current font. If the painter's font is changed later, the font info object is not updated.

Source: https://doc.qt.io/archives/qt-5.15/qfontinfo.html

Complete member index

Every captured member retains its own identity. Identical captured declaration text is linked once; this does not establish native inheritance or interchangeable objects.

Member Kind Signature Summary
__init__ function (self, *args: Any, **kwargs: Any) -> None Native constructor; consult class documentation for supported overloads. (shared captured text)
bold function (self) -> bool X.bold() -> bool
className function (self, *args: Any, **kwargs: Any) -> Any Return the classname of the object (shared captured text)
delete function (self, *args: Any, **kwargs: Any) -> Any Deletes the C++ object (at your own risk, my friend!) (shared captured text)
exactMatch function (self) -> bool X.exactMatch() -> bool
family function (self) -> str X.family() -> str
fixedPitch function (self) -> bool X.fixedPitch() -> bool
help function (self, *args: Any, **kwargs: Any) -> Any Shows the help of available methods for this class (shared captured text)
inherits function (self, *args: Any, **kwargs: Any) -> Any Returns if the class inherits or is of given type name (shared captured text)
italic function (self) -> bool X.italic() -> bool
overline function (self) -> bool X.overline() -> bool
pixelSize function (self) -> int X.pixelSize() -> int
pointSize function (self) -> int X.pointSize() -> int
pointSizeF function (self) -> float X.pointSizeF() -> float
rawMode function (self) -> bool X.rawMode() -> bool
strikeOut function (self) -> bool X.strikeOut() -> bool
style function (self) -> Any Returns the style value of the matched window system font.
styleHint function (self) -> Any Returns the style of the matched window system font.
styleName function (self) -> str X.styleName() -> str
swap function (self, other: Any) -> None Swaps this font info instance with other.
underline function (self) -> bool X.underline() -> bool
weight function (self) -> int X.weight() -> int