FontInfo QML Type
提供有关如何解决给定字体查询的信息。更多
Import Statement: | import QtQuick |
Since: | Qt 6.9 |
属性
- bold : bool
- family : string
- fixedPitch : bool
- font : font
- italic : bool
- pixelSize : int
- pointSize : real
- style : enum
- styleName : real
- variableAxes : list
- weight : int
详细说明
FontInfo 为 Qt 的字体选择系统提供与字体查询匹配的实际字体的信息。
它对应于 C++ 中的类QFontInfo 。
FontInfo { id: fontInfo font.family: "Arial" } Text { text: fontInfo.family === "Arial" ? "System has 'Arial' font" : "System does not have 'Arial' font" }
另请参阅 FontMetrics 和TextMetrics 。
属性文档
bold : bool |
如果 weight() 返回的值大于 Font.Normal,则该属性为 true;否则返回 false。
另请参阅 weight 和QFontInfo::bold() 。
family : string |
该属性保存匹配字体的族。
另请参阅 QFontInfo::family()。
fixedPitch : bool |
该属性用于保存匹配字体的固定间距值。
另请参阅 QFontInfo::fixedPitch()。
italic : bool |
该属性用于保存匹配字体的斜体值。
另请参阅 QFontInfo::italic()。
pixelSize : int |
该属性用于保存匹配字体的像素大小。
另请参阅 QFontInfo::pixelSize()。
pointSize : real |
该属性用于保存匹配字体的点大小。
另请参阅 QFontInfo::pointSizeF()。
style : enum |
该属性用于保存匹配字体的样式。
常量 | 说明 |
---|---|
Font.StyleNormal | 包含不带斜体的普通字形。 |
Font.StyleItalic | 包含设计用于表示斜体文本的字形。 |
Font.StyleOblique | 包含具有斜体外观的字形,通常不是专门设计的,而是通过在字体族的正常字形上应用斜体产生的。 |
另请参阅 QFontInfo::style()。
styleName : real |
该属性包含匹配字体的样式名称(或 "子字体")。
另请参见 QFontInfo::styleName()。
variableAxes : list |
该属性包含匹配字体支持的可变轴。该列表由QFontVariableAxis 对象组成,其属性为tag
,name
,minimumValue
,maximumValue
, 和defaultValue
。
另请参阅 QFontInfo::variableAxes() 和QFontVariableAxis 。
weight : int |
该属性包含匹配字体的权重。
另请参阅 bold 和QFontInfo::weight()。
© 2025 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.