FontInfo QML Type

Provides info about how a given font query is resolved. More...

Import Statement: import QtQuick
Since: Qt 6.9

Properties

Detailed Description

FontInfo provides information about the actual font which is matched for a font query by Qt's font selection system.

It corresponds to the class QFontInfo in C++.

FontInfo {
    id: fontInfo
    font.family: "Arial"
}

Text {
    text: fontInfo.family === "Arial"
        ? "System has 'Arial' font"
        : "System does not have 'Arial' font"
}

See also FontMetrics and TextMetrics.

Property Documentation

bold : bool [read-only]

This property is true if weight() would return a value greater than Font.Normal; otherwise returns false.

See also weight() and QFontInfo::bold().


family : string [read-only]

This property holds the family of the matched font.

See also QFontInfo::family().


fixedPitch : bool [read-only]

This property holds the fixed pitch value of the matched font.

See also QFontInfo::fixedPitch().


font : font

This property holds the font which will be resolved by the FontInfo.


italic : bool [read-only]

This property holds the italic value of the matched font.

See also QFontInfo::italic().


pixelSize : int [read-only]

This property holds the pixel size of the matched font.

See also QFontInfo::pixelSize().


pointSize : real [read-only]

This property holds the point size of the matched font.

See also QFontInfo::pointSizeF().


style : enum [read-only]

This property holds the style of the matched font.

ConstantDescription
Font.StyleNormalContains normal glyphs without italic slant.
Font.StyleItalicContains glyphs designed to be used for representing italicized text.
Font.StyleObliqueContains glyphs with an italic appearance, typically not specially designed, but rather produced by applying a slant on the font family's normal glyphs.

See also QFontInfo::style().


styleName : real [read-only]

This property holds the style name (or "sub-family") of the mathed font.

See also QFontInfo::styleName().


variableAxes : list [read-only]

This property holds the variable axes supported by the matched font. The list consists of QFontVariableAxis objects, which have the properties tag, name, minimumValue, maximumValue, and defaultValue.

See also QFontInfo::variableAxes() and QFontVariableAxis.


weight : int [read-only]

This property holds the weight of the matched font.

See also QFontInfo::weight().


© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.