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 ().