Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QFontVariableAxis Class Reference

\reentrant \inmodule QtGui More...

#include <qfontvariableaxis.h>

Collaboration diagram for QFontVariableAxis:

Public Member Functions

Q_GUI_EXPORT QFontVariableAxis ()
 QFontVariableAxis (QFontVariableAxis &&other) noexcept=default
Q_GUI_EXPORT QFontVariableAxis (const QFontVariableAxis &axis)
 Creates a QFontVariableAxis object that is a copy of the given axis.
Q_GUI_EXPORT ~QFontVariableAxis ()
 Destroys this QFontVariableAxis object.
void swap (QFontVariableAxis &other) noexcept
Q_GUI_EXPORT QFontVariableAxisoperator= (const QFontVariableAxis &axis)
 Assigns the given axis to this QFontVariableAxis.
Q_GUI_EXPORT QFont::Tag tag () const
 Returns the tag of the axis.
Q_GUI_EXPORT void setTag (QFont::Tag tag)
 Sets the tag of QFontVariableAxis to tag.
Q_GUI_EXPORT QString name () const
 Returns the name of the axis, if provided by the font.
Q_GUI_EXPORT void setName (const QString &name)
 Sets the name of this QFontVariableAxis to name.
Q_GUI_EXPORT qreal minimumValue () const
 Returns the minimum value of the axis.
Q_GUI_EXPORT void setMinimumValue (qreal minimumValue)
 Sets the minimum value of this QFontVariableAxis to minimumValue.
Q_GUI_EXPORT qreal maximumValue () const
 Returns the maximum value of the axis.
Q_GUI_EXPORT void setMaximumValue (qreal maximumValue)
 Sets the maximum value of this QFontVariableAxis to maximumValue.
Q_GUI_EXPORT qreal defaultValue () const
 Returns the default value of the axis.
Q_GUI_EXPORT void setDefaultValue (qreal defaultValue)
 Sets the default value of this QFontVariableAxis to defaultValue.

Properties

QByteArray tag
QString name
qreal minimumValue
 the minimum value of the axis.
qreal maximumValue
qreal defaultValue

Friends

Q_GUI_EXPORT friend QDebug operator<< (QDebug debug, const QFontVariableAxis &axis)

Detailed Description

\reentrant \inmodule QtGui

Since
6.9

The QFontVariableAxis class represents a variable axis in a font.

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 \l{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 \l{QFont::setVariableAxis()} and passing in the \l{tag()}.

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

Definition at line 17 of file qfontvariableaxis.h.

Constructor & Destructor Documentation

◆ QFontVariableAxis() [1/3]

QFontVariableAxis::QFontVariableAxis ( )

Definition at line 44 of file qfontvariableaxis.cpp.

◆ QFontVariableAxis() [2/3]

QFontVariableAxis::QFontVariableAxis ( QFontVariableAxis && other)
defaultnoexcept

◆ QFontVariableAxis() [3/3]

QFontVariableAxis::QFontVariableAxis ( const QFontVariableAxis & axis)
default

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

See also
operator=()

◆ ~QFontVariableAxis()

QFontVariableAxis::~QFontVariableAxis ( )
default

Destroys this QFontVariableAxis object.

Member Function Documentation

◆ defaultValue()

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.

See also
minimumValue(), maximumValue()

Definition at line 190 of file qfontvariableaxis.cpp.

◆ 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.

See also
minimumValue(), defaultValue()

Definition at line 161 of file qfontvariableaxis.cpp.

◆ minimumValue()

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.

See also
maximumValue(), defaultValue()

Definition at line 132 of file qfontvariableaxis.cpp.

◆ name()

QString QFontVariableAxis::name ( ) const

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

See also
tag()

Definition at line 98 of file qfontvariableaxis.cpp.

◆ operator=()

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

Assigns the given axis to this QFontVariableAxis.

See also
QFontVariableAxis()

Definition at line 218 of file qfontvariableaxis.cpp.

◆ setDefaultValue()

void QFontVariableAxis::setDefaultValue ( qreal defaultValue)

Sets the default value of this QFontVariableAxis to defaultValue.

Note
Typically, there will be no need to call this function as it will not affect the font itself, only this particular representation.
See also
defaultValue()

Definition at line 204 of file qfontvariableaxis.cpp.

◆ setMaximumValue()

void QFontVariableAxis::setMaximumValue ( qreal maximumValue)

Sets the maximum value of this QFontVariableAxis to maximumValue.

Note
Typically, there will be no need to call this function as it will not affect the font itself, only this particular representation.
See also
maximumValue()

Definition at line 175 of file qfontvariableaxis.cpp.

◆ setMinimumValue()

void QFontVariableAxis::setMinimumValue ( qreal minimumValue)

Sets the minimum value of this QFontVariableAxis to minimumValue.

Note
Typically, there will be no need to call this function as it will not affect the font itself, only this particular representation.
See also
minimumValue()

Definition at line 146 of file qfontvariableaxis.cpp.

◆ setName()

void QFontVariableAxis::setName ( const QString & name)

Sets the name of this QFontVariableAxis to name.

Note
Typically, there will be no need to call this function as it will not affect the font itself, only this particular representation.
See also
name()

Definition at line 112 of file qfontvariableaxis.cpp.

◆ setTag()

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

Sets the tag of QFontVariableAxis to tag.

Note
Typically, there will be no need to call this function as it will not affect the font itself, only this particular representation.
See also
tag()

Definition at line 84 of file qfontvariableaxis.cpp.

◆ swap()

void QFontVariableAxis::swap ( QFontVariableAxis & other)
inlinenoexcept

Definition at line 33 of file qfontvariableaxis.h.

◆ 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.

See also
QFont::setVariableAxis(), name()

Definition at line 70 of file qfontvariableaxis.cpp.

◆ operator<<

Q_GUI_EXPORT friend QDebug operator<< ( QDebug debug,
const QFontVariableAxis & axis )
friend

Definition at line 234 of file qfontvariableaxis.cpp.

Property Documentation

◆ defaultValue

qreal QFontVariableAxis::defaultValue
read

Definition at line 26 of file qfontvariableaxis.h.

◆ maximumValue

qreal QFontVariableAxis::maximumValue
read

Definition at line 25 of file qfontvariableaxis.h.

◆ minimumValue

qreal QFontVariableAxis::minimumValue
read

the minimum value of the axis.

Definition at line 24 of file qfontvariableaxis.h.

◆ name

QString QFontVariableAxis::name
read

◆ tag

QByteArray QFontVariableAxis::tag
read

Definition at line 22 of file qfontvariableaxis.h.


The documentation for this class was generated from the following files: