VariableAxis

Overview

VariableAxis is a class in Aspose.Font FOSS for Python.

VariableAxis.normalize(value) returns the normalized (0‑1) position of a raw axis coordinate according to the axis’s defined range.

This class provides 14 methods for working with VariableAxis objects in Python programs. Available methods include: clamp, css_variation_setting, describe_value, format_value, get_preset, language_profiles, localization_coverage, localization_resolution, localized_labels, name, normalize, requested_language_hints, and 2 additional methods. All public members are accessible to any Python application after installing the Aspose.Font FOSS for Python package. Properties: available_languages, css_axis_tag, default_preset, default_ratio, default_value, description, and 17 more.

Properties

NameTypeAccessDescription
available_languagestuple[str, ...]ReadGets the available languages.
labelstrReadGets the label.
descriptionstr | NoneReadGets the description.
unit_labelstrReadGets the unit label.
presentation_kindstrReadGets the presentation kind.
display_groupstrReadGets the display group.
display_orderintReadGets the display order.
is_registered_axisboolReadGets the is registered axis.
recommended_stepfloatReadGets the recommended step.
spanfloatReadGets the span.
default_ratiofloat | NoneReadGets the default ratio.
presetslist[VariableAxisPreset]ReadGets the presets.
is_hiddenboolReadGets the is hidden.
default_presetVariableAxisPreset | NoneReadGets the default preset.
range_summarystrReadGets the range summary.
css_axis_tagstrReadGets the css axis tag.
tagstrRead/WriteGets or sets the tag.
min_valuefloatRead/WriteGets or sets the min value.
default_valuefloatRead/WriteGets or sets the default value.
max_valuefloatRead/WriteGets or sets the max value.
flagsintRead/WriteGets or sets the flags.
name_idintRead/WriteGets or sets the name id.
names_by_languagedict[str, str]Read/WriteGets or sets the names by language.

Methods

SignatureDescription
name(language: str | tuple[str, ...])str | NoneReturns the axis name string for the given language or None
localization_resolution(language: str | tuple[str, ...])LocalizationResolutionReturns a LocalizationResolution indicating language granularity
localization_coverage(language: str | tuple[str, ...])LocalizationCoverageReturns a LocalizationCoverage describing how fully the axis is localized
localized_labels(preferred_languages: str | tuple[str, ...])tuple[tuple[str, str], ...]Returns a tuple of (language, label) pairs for the requested languages
requested_language_hints(language: str | tuple[str, ...])tuple[RequestedLanguageHint, ...]Returns a tuple of RequestedLanguageHint objects for the given language
language_profiles(language: str | tuple[str, ...])tuple[LanguageProfile, ...]Calls language_profiles on this VariableAxis instance.
clamp(value: float)float` returns the supplied coordinate clamped to the axis’s defined range
normalize(value: float)floatScales a raw axis coordinate to the 0‑1 normalized range defined by the axis’s start, peak and end points
format_value(value: float)strReturns a string representation of the value using the axis unit
describe_value(value: float)strReturns a human‑readable description of the value with unit label
css_variation_setting(value: float)strReturns a CSS string for the axis variation setting
ui_control(language: str | tuple[str, ...])dict[str, object]Returns a dictionary describing a UI control for the axis in the given language
get_preset(name: str)VariableAxisPreset | NoneReturns the VariableAxisPreset matching the name or None
to_presentation(language: str | tuple[str, ...], suggested_values: tuple[float, ...] | list[float] | None)dict[str, object]Returns a dict describing the axis for UI, optionally with suggested values

See Also