Skip to content

PythonQt.QtGui.QFontDatabase · declarations 001

Back to PythonQt.QtGui.QFontDatabase

Any instance-attribute

Any: Any

Cyrillic instance-attribute

Cyrillic: Any

Devanagari instance-attribute

Devanagari: Any

FixedFont instance-attribute

FixedFont: Any

GeneralFont instance-attribute

GeneralFont: Any

Gurmukhi instance-attribute

Gurmukhi: Any

Ogham instance-attribute

Ogham: Any

Runic instance-attribute

Runic: Any

SimplifiedChinese instance-attribute

SimplifiedChinese: Any

SmallestReadableFont instance-attribute

SmallestReadableFont: Any

Symbol instance-attribute

Symbol: Any

SystemFont instance-attribute

SystemFont: type

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

int('0b100', base=0) 4

Thaana instance-attribute

Thaana: Any

TitleFont instance-attribute

TitleFont: Any

TraditionalChinese instance-attribute

TraditionalChinese: Any

WritingSystem instance-attribute

WritingSystem: type

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

int('0b100', base=0) 4

WritingSystemsCount instance-attribute

WritingSystemsCount: Any

addApplicationFont

addApplicationFont(fileName: str) -> int

X.addApplicationFont(fileName) -> int

Supplemental documentation: Qt 5 reference:

[static] int QFontDatabase::addApplicationFont(const QString \&fileName)

Loads the font from the file specified by fileName and makes it available to the application. An ID is returned that can be used to remove the font again with removeApplicationFont() or to retrieve the list of family names contained in the font.

The function returns -1 if the font could not be loaded.

Currently only TrueType fonts, TrueType font collections, and OpenType fonts are supported.

This function was introduced in Qt 4.2.

See also addApplicationFontFromData(), applicationFontFamilies(), and removeApplicationFont().

Upstream PySide2 reference signatures (binding differences may apply):

addApplicationFont(fileName: str) -> int

Source: https://doc.qt.io/archives/qt-5.15/qfontdatabase.html#addApplicationFont

addApplicationFontFromData

addApplicationFontFromData(fontData: Any) -> int

X.addApplicationFontFromData(fontData) -> int

Supplemental documentation: Qt 5 reference:

[static] int QFontDatabase::addApplicationFontFromData(const QByteArray \&fontData)

Loads the font from binary data specified by fontData and makes it available to the application. An ID is returned that can be used to remove the font again with removeApplicationFont() or to retrieve the list of family names contained in the font.

The function returns -1 if the font could not be loaded.

Currently only TrueType fonts, TrueType font collections, and OpenType fonts are supported.

This function was introduced in Qt 4.2.

See also addApplicationFont(), applicationFontFamilies(), and removeApplicationFont().

Upstream PySide2 reference signatures (binding differences may apply):

addApplicationFontFromData(fontData: PySide2.QtCore.QByteArray) -> int

Source: https://doc.qt.io/archives/qt-5.15/qfontdatabase.html#addApplicationFontFromData

applicationFontFamilies

applicationFontFamilies(id: int) -> tuple

X.applicationFontFamilies(id) -> tuple

Supplemental documentation: Qt 5 reference:

[static] QStringList QFontDatabase::applicationFontFamilies(int id)

Returns a list of font families for the given application font identified by id.

This function was introduced in Qt 4.2.

See also addApplicationFont() and addApplicationFontFromData().

Upstream PySide2 reference signatures (binding differences may apply):

applicationFontFamilies(id: int) -> typing.List[str]

Source: https://doc.qt.io/archives/qt-5.15/qfontdatabase.html#applicationFontFamilies

bold

bold(family: str, style: str) -> bool

X.bold(family, style) -> bool

Supplemental documentation: Qt 5 reference:

bool QFontDatabase::bold(const QString \&family, const QString \&style) const

Returns true if the font that has family family and style style is bold; otherwise returns false.

See also italic() and weight().

Upstream PySide2 reference signatures (binding differences may apply):

bold(self, family: str, style: str) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qfontdatabase.html#bold

families

families(writingSystem: Any) -> tuple

X.families(writingSystem) -> tuple

Supplemental documentation: Qt 5 reference:

QStringList QFontDatabase::families(QFontDatabase::WritingSystem writingSystem \= Any) const

Returns a sorted list of the available font families which support the writingSystem.

If a family exists in several foundries, the returned name for that font is in the form "family [foundry]". Examples: "Times [Adobe]", "Times [Cronyx]", "Palatino".

See also writingSystems().

Upstream PySide2 reference signatures (binding differences may apply):

families(self, writingSystem: PySide2.QtGui.QFontDatabase.WritingSystem=...) -> typing.List[str]

Source: https://doc.qt.io/archives/qt-5.15/qfontdatabase.html#families

font

font(family: str, style: str, pointSize: int) -> Any

X.font(family, style, pointSize) -> PythonQt.QtGui.QFont

Supplemental documentation: Qt 5 reference:

QFont QFontDatabase::font(const QString \&family, const QString \&style, int pointSize) const

Returns a QFont object that has family family, style style and point size pointSize. If no matching font could be created, a QFont object that uses the application's default font is returned.

Upstream PySide2 reference signatures (binding differences may apply):

font(self, family: str, style: str, pointSize: int) -> PySide2.QtGui.QFont

Source: https://doc.qt.io/archives/qt-5.15/qfontdatabase.html#font

hasFamily

hasFamily(family: str) -> bool

X.hasFamily(family) -> bool

Upstream PySide2 reference signatures (binding differences may apply):

hasFamily(self, family: str) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qfontdatabase.html#hasFamily

isBitmapScalable

isBitmapScalable(family: str, style: str) -> bool

X.isBitmapScalable(family, style) -> bool

Supplemental documentation: Qt 5 reference:

bool QFontDatabase::isBitmapScalable(const QString \&family, const QString \&style \= QString()) const

Returns true if the font that has family family and style style is a scalable bitmap font; otherwise returns false. Scaling a bitmap font usually produces an unattractive hardly readable result, because the pixels of the font are scaled. If you need to scale a bitmap font it is better to scale it to one of the fixed sizes returned by smoothSizes().

See also isScalable() and isSmoothlyScalable().

Upstream PySide2 reference signatures (binding differences may apply):

isBitmapScalable(self, family: str, style: str=...) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qfontdatabase.html#isBitmapScalable

isFixedPitch

isFixedPitch(family: str, style: str) -> bool

X.isFixedPitch(family, style) -> bool

Supplemental documentation: Qt 5 reference:

bool QFontDatabase::isFixedPitch(const QString \&family, const QString \&style \= QString()) const

Returns true if the font that has family family and style style is fixed pitch; otherwise returns false.

Upstream PySide2 reference signatures (binding differences may apply):

isFixedPitch(self, family: str, style: str=...) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qfontdatabase.html#isFixedPitch

isPrivateFamily

isPrivateFamily(family: str) -> bool

X.isPrivateFamily(family) -> bool

Supplemental documentation: Qt 5 reference:

bool QFontDatabase::isPrivateFamily(const QString \&family) const

Returns true if and only if the family font family is private.

This happens, for instance, on macOS and iOS, where the system UI fonts are not accessible to the user. For completeness, QFontDatabase::families() returns all font families, including the private ones. You should use this function if you are developing a font selection control in order to keep private fonts hidden.

This function was introduced in Qt 5.5.

See also families().

Upstream PySide2 reference signatures (binding differences may apply):

isPrivateFamily(self, family: str) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qfontdatabase.html#isPrivateFamily

isScalable

isScalable(family: str, style: str) -> bool

X.isScalable(family, style) -> bool

Supplemental documentation: Qt 5 reference:

bool QFontDatabase::isScalable(const QString \&family, const QString \&style \= QString()) const

Returns true if the font that has family family and style style is scalable; otherwise returns false.

See also isBitmapScalable() and isSmoothlyScalable().

Upstream PySide2 reference signatures (binding differences may apply):

isScalable(self, family: str, style: str=...) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qfontdatabase.html#isScalable

isSmoothlyScalable

isSmoothlyScalable(family: str, style: str) -> bool

X.isSmoothlyScalable(family, style) -> bool

Supplemental documentation: Qt 5 reference:

bool QFontDatabase::isSmoothlyScalable(const QString \&family, const QString \&style \= QString()) const

Returns true if the font that has family family and style style is smoothly scalable; otherwise returns false. If this function returns true, it's safe to scale this font to any size, and the result will always look attractive.

See also isScalable() and isBitmapScalable().

Upstream PySide2 reference signatures (binding differences may apply):

isSmoothlyScalable(self, family: str, style: str=...) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qfontdatabase.html#isSmoothlyScalable

italic

italic(family: str, style: str) -> bool

X.italic(family, style) -> bool

Supplemental documentation: Qt 5 reference:

bool QFontDatabase::italic(const QString \&family, const QString \&style) const

Returns true if the font that has family family and style style is italic; otherwise returns false.

See also weight() and bold().

Upstream PySide2 reference signatures (binding differences may apply):

italic(self, family: str, style: str) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qfontdatabase.html#italic

pointSizes

pointSizes(family: str, style: str) -> tuple

X.pointSizes(family, style) -> tuple

Supplemental documentation: Qt 5 reference:

QList\<int> QFontDatabase::pointSizes(const QString \&family, const QString \&styleName \= QString())

Returns a list of the point sizes available for the font that has family family and style styleName. The list may be empty.

See also smoothSizes() and standardSizes().

Upstream PySide2 reference signatures (binding differences may apply):

pointSizes(self, family: str, style: str=...) -> typing.List[int]

Source: https://doc.qt.io/archives/qt-5.15/qfontdatabase.html#pointSizes

removeAllApplicationFonts

removeAllApplicationFonts() -> bool

X.removeAllApplicationFonts() -> bool

Supplemental documentation: Qt 5 reference:

[static] bool QFontDatabase::removeAllApplicationFonts()

Removes all application-local fonts previously added using addApplicationFont() and addApplicationFontFromData().

Returns true if unloading of the fonts succeeded; otherwise returns false.

This function was introduced in Qt 4.2.

See also removeApplicationFont(), addApplicationFont(), and addApplicationFontFromData().

Upstream PySide2 reference signatures (binding differences may apply):

removeAllApplicationFonts() -> bool

Source: https://doc.qt.io/archives/qt-5.15/qfontdatabase.html#removeAllApplicationFonts

removeApplicationFont

removeApplicationFont(id: int) -> bool

X.removeApplicationFont(id) -> bool

Supplemental documentation: Qt 5 reference:

[static] bool QFontDatabase::removeApplicationFont(int id)

Removes the previously loaded application font identified by id. Returns true if unloading of the font succeeded; otherwise returns false.

This function was introduced in Qt 4.2.

See also removeAllApplicationFonts(), addApplicationFont(), and addApplicationFontFromData().

Upstream PySide2 reference signatures (binding differences may apply):

removeApplicationFont(id: int) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qfontdatabase.html#removeApplicationFont

smoothSizes

smoothSizes(family: str, style: str) -> tuple

X.smoothSizes(family, style) -> tuple

Supplemental documentation: Qt 5 reference:

QList\<int> QFontDatabase::smoothSizes(const QString \&family, const QString \&styleName)

Returns the point sizes of a font that has family family and style styleName that will look attractive. The list may be empty. For non-scalable fonts and bitmap scalable fonts, this function is equivalent to pointSizes().

See also pointSizes() and standardSizes().

Upstream PySide2 reference signatures (binding differences may apply):

smoothSizes(self, family: str, style: str) -> typing.List[int]

Source: https://doc.qt.io/archives/qt-5.15/qfontdatabase.html#smoothSizes

standardSizes

standardSizes() -> tuple

X.standardSizes() -> tuple

Supplemental documentation: Qt 5 reference:

[static] QList\<int> QFontDatabase::standardSizes()

Returns a list of standard font sizes.

See also smoothSizes() and pointSizes().

Upstream PySide2 reference signatures (binding differences may apply):

standardSizes() -> typing.List[int]

Source: https://doc.qt.io/archives/qt-5.15/qfontdatabase.html#standardSizes

styleString

styleString(font: Any) -> str

X.styleString(font) -> str

Supplemental documentation: Qt 5 reference:

QString QFontDatabase::styleString(const QFont \&font)

Returns a string that describes the style of the font. For example, "Bold Italic", "Bold", "Italic" or "Normal". An empty string may be returned.

QString QFontDatabase::styleString(const QFontInfo \&fontInfo)

Returns a string that describes the style of the fontInfo. For example, "Bold Italic", "Bold", "Italic" or "Normal". An empty string may be returned.

Upstream PySide2 reference signatures (binding differences may apply):

styleString(self, font: PySide2.QtGui.QFont) -> str
styleString(self, fontInfo: PySide2.QtGui.QFontInfo) -> str

Source: https://doc.qt.io/archives/qt-5.15/qfontdatabase.html#styleString

styles

styles(family: str) -> tuple

X.styles(family) -> tuple

Supplemental documentation: Qt 5 reference:

QStringList QFontDatabase::styles(const QString \&family) const

Returns a list of the styles available for the font family family. Some example styles: "Light", "Light Italic", "Bold", "Oblique", "Demi". The list may be empty.

See also families().

Upstream PySide2 reference signatures (binding differences may apply):

styles(self, family: str) -> typing.List[str]

Source: https://doc.qt.io/archives/qt-5.15/qfontdatabase.html#styles

supportsThreadedFontRendering

supportsThreadedFontRendering() -> bool

X.supportsThreadedFontRendering() -> bool

Upstream PySide2 reference signatures (binding differences may apply):

supportsThreadedFontRendering() -> bool

Source: https://doc.qt.io/archives/qt-5.15/qfontdatabase.html#supportsThreadedFontRendering

systemFont

systemFont(type: Any) -> Any

X.systemFont(type) -> PythonQt.QtGui.QFont

Supplemental documentation: Qt 5 reference:

[static] QFont QFontDatabase::systemFont(QFontDatabase::SystemFont type)

Returns the most adequate font for a given type case for proper integration with the system's look and feel.

This function was introduced in Qt 5.2.

See also QGuiApplication::font().

Upstream PySide2 reference signatures (binding differences may apply):

systemFont(type: PySide2.QtGui.QFontDatabase.SystemFont) -> PySide2.QtGui.QFont

Source: https://doc.qt.io/archives/qt-5.15/qfontdatabase.html#systemFont

weight

weight(family: str, style: str) -> int

X.weight(family, style) -> int

Supplemental documentation: Qt 5 reference:

int QFontDatabase::weight(const QString \&family, const QString \&style) const

Returns the weight of the font that has family family and style style. If there is no such family and style combination, returns -1.

See also italic() and bold().

Upstream PySide2 reference signatures (binding differences may apply):

weight(self, family: str, style: str) -> int

Source: https://doc.qt.io/archives/qt-5.15/qfontdatabase.html#weight