PySide6.QtGui.QFontVariableAxis

class QFontVariableAxis

The QFontVariableAxis class represents a variable axis in a font. More

Added in version 6.9.

Synopsis

Properties

Methods

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description

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 variableAxes() to retrieve a list of the variable axes defined for a given font. Specific values can be provided for an axis by using setVariableAxis() and passing in the tag() .

Note

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

Note

Properties can be used directly when from __feature__ import true_property is used or via accessor functions otherwise.

property defaultValueᅟ: float
Access functions:
property maximumValueᅟ: float
Access functions:
property minimumValueᅟ: float
Access functions:
property nameᅟ: str
Access functions:
property tagᅟ: QByteArray

Access functions:

__init__()
__init__(axis)
Parameters:

axisQFontVariableAxis

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

See also

operator=()

defaultValue()
Return type:

float

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 of property defaultValueᅟ .

maximumValue()
Return type:

float

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

Getter of property maximumValueᅟ .

minimumValue()
Return type:

float

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

Getter of property minimumValueᅟ .

name()
Return type:

str

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

See also

setName() tag()

Getter of property nameᅟ .

setDefaultValue(defaultValue)
Parameters:

defaultValue – float

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

setMaximumValue(maximumValue)
Parameters:

maximumValue – float

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

setMinimumValue(minimumValue)
Parameters:

minimumValue – float

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

setName(name)
Parameters:

name – str

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

setTag(tag)
Parameters:

tagTag

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

swap(other)
Parameters:

otherQFontVariableAxis

tag()
Return type:

Tag

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.