QFontVariableAxis Class

The QFontVariableAxis class represents a variable axis in a font. 更多...

头: #include <QFontVariableAxis>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui
Since: Qt 6.9

注意: 此类的所有函数 可重入 .

公共函数

QFontVariableAxis (const QFontVariableAxis & axis )
~QFontVariableAxis ()
qreal defaultValue () const
qreal maximumValue () const
qreal minimumValue () const
QString name () const
void setDefaultValue (qreal defaultValue )
void setMaximumValue (qreal maximumValue )
void setMinimumValue (qreal minimumValue )
void setName (const QString & name )
void setTag (QFont::Tag tag )
QFont::Tag tag () const
QFontVariableAxis & operator= (const QFontVariableAxis & axis )

详细描述

Variable fonts provide a way to store multiple variations (with different weights, widths or styles) in the same font file. The variations are given as floating point values for a pre-defined set of parameters, called "variable axes".

Specific parameterizations (sets of values for the axes in a font) can be selected using the properties in QFont , same as with traditional subfamilies that are defined as stand-alone font files. But with variable fonts, arbitrary values can be provided for each axis to gain a fine-grained customization of the font's appearance.

QFontVariableAxis contains information of one axis. Use QFontInfo::variableAxes () to retrieve a list of the variable axes defined for a given font. Specific values can be provided for an axis by using QFont::setVariableAxis () and passing in the tag ().

注意: On Windows, variable axes are not supported if the optional GDI font backend is in use.

成员函数文档编制

QFontVariableAxis:: QFontVariableAxis (const QFontVariableAxis & axis )

Creates a QFontVariableAxis object that is a copy of the given axis .

另请参阅 operator= ().

[noexcept] QFontVariableAxis:: ~QFontVariableAxis ()

销毁此 QFontVariableAxis 对象。

qreal QFontVariableAxis:: defaultValue () const

Returns the default value of the axis. This is the value the axis will have if none has been provided in the QFont query.

注意: Getter function for property defaultValue.

另请参阅 setDefaultValue (), minimumValue (),和 maximumValue ().

qreal QFontVariableAxis:: maximumValue () const

Returns the maximum value of the axis. Setting the axis to a value which is higher than this is not supported.

注意: Getter function for property maximumValue.

另请参阅 setMaximumValue (), minimumValue (),和 defaultValue ().

qreal QFontVariableAxis:: minimumValue () const

Returns the minimum value of the axis. Setting the axis to a value which is lower than this is not supported.

注意: Getter function for property minimumValue.

另请参阅 setMinimumValue (), maximumValue (),和 defaultValue ().

QString QFontVariableAxis:: 名称 () const

Returns the name of the axis, if provided by the font.

注意: Getter function for property name.

另请参阅 setName () 和 tag ().

void QFontVariableAxis:: setDefaultValue ( qreal defaultValue )

Sets the default value of this QFontVariableAxis to defaultValue .

注意: Typically, there will be no need to call this function as it will not affect the font itself, only this particular representation.

另请参阅 defaultValue ().

void QFontVariableAxis:: setMaximumValue ( qreal maximumValue )

Sets the maximum value of this QFontVariableAxis to maximumValue .

注意: Typically, there will be no need to call this function as it will not affect the font itself, only this particular representation.

另请参阅 maximumValue ().

void QFontVariableAxis:: setMinimumValue ( qreal minimumValue )

Sets the minimum value of this QFontVariableAxis to minimumValue .

注意: Typically, there will be no need to call this function as it will not affect the font itself, only this particular representation.

另请参阅 minimumValue ().

void QFontVariableAxis:: setName (const QString & name )

Sets the name of this QFontVariableAxis to name .

注意: Typically, there will be no need to call this function as it will not affect the font itself, only this particular representation.

另请参阅 name ().

void QFontVariableAxis:: setTag ( QFont::Tag tag )

Sets the tag of QFontVariableAxis to tag .

注意: Typically, there will be no need to call this function as it will not affect the font itself, only this particular representation.

另请参阅 tag ().

QFont::Tag QFontVariableAxis:: tag () const

Returns the tag of the axis. This is a four-character sequence which identifies the axis. Certain tags have standardized meanings, such as "wght" (weight) and "wdth" (width), but any sequence of four latin-1 characters is a valid tag. By convention, non-standard/custom axes are denoted by tags in all uppercase.

另请参阅 setTag (), QFont::setVariableAxis (),和 name ().

QFontVariableAxis &QFontVariableAxis:: operator= (const QFontVariableAxis & axis )

赋值给定 axis 到此 QFontVariableAxis .

另请参阅 QFontVariableAxis ().