PySide6.QtGui.QFontVariableAxis¶
- class QFontVariableAxis¶
The
QFontVariableAxisclass represents a variable axis in a font.Details
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.QFontVariableAxiscontains information of one axis. UsevariableAxes()to retrieve a list of the variable axes defined for a given font. Specific values can be provided for an axis by usingsetVariableAxis()and passing in thetag().Note
On Windows, variable axes are not supported if the optional GDI font backend is in use.
Added in version 6.9.
Synopsis¶
Properties¶
Methods¶
def
__init__()def
defaultValue()def
maximumValue()def
minimumValue()def
name()def
setName()def
setTag()def
swap()def
tag()
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
Note
Properties can be used directly when
from __feature__ import true_propertyis 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:
axis –
QFontVariableAxis
Creates a
QFontVariableAxisobject that is a copy of the givenaxis.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
QFontquery.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.
Getter of property
nameᅟ.- setDefaultValue(defaultValue)¶
- Parameters:
defaultValue – float
Sets the default value of this
QFontVariableAxistodefaultValue.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
- setMaximumValue(maximumValue)¶
- Parameters:
maximumValue – float
Sets the maximum value of this
QFontVariableAxistomaximumValue.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
- setMinimumValue(minimumValue)¶
- Parameters:
minimumValue – float
Sets the minimum value of this
QFontVariableAxistominimumValue.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
- setName(name)¶
- Parameters:
name – str
Sets the name of this
QFontVariableAxistoname.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
Sets the tag of
QFontVariableAxistotag.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
- swap(other)¶
- Parameters:
other –
QFontVariableAxis
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