Skip to main content

FontVariationAxis Struct

Definition​

Namespace:Avalonia.Media
Assembly:Avalonia.Base
Package:Avalonia

Describes a single variation axis declared by a variable font's fvar table.

public struct FontVariationAxis

Inheritance: ValueType -> FontVariationAxis

Implements: IEquatable<FontVariationAxis>

Remarks​

Variation axes are the design dimensions a variable font exposes — typical examples include wght (weight, 1..1000), wdth (width, percentage), opsz (optical size, points), ital (italic, 0..1), and slnt (slant, degrees).

Values are in user-space: the same values the font designer chose to expose to end users (e.g. weight 700 for "Bold"). The platform-neutral Avalonia.Media.FontVariationSettings also speaks user-space values; they are normalized into [-1, 1] through the font's fvar / avar tables per font when the settings are applied.

Constructors​

NameDescription
FontVariationAxisDescribes a single variation axis declared by a variable font's fvar table.

FontVariationAxis Constructor​

Describes a single variation axis declared by a variable font's fvar table.

public FontVariationAxis(Avalonia.Media.Fonts.OpenTypeTag Tag, string Name, float MinimumValue, float DefaultValue, float MaximumValue, bool IsHidden)

Parameters​

Tag Avalonia.Media.Fonts.OpenTypeTag

The four-character OpenType axis tag (e.g. wght).

Name string

A human-readable axis name resolved from the font's name table. Falls back to the tag's string form when no name record is available.

MinimumValue float

The minimum allowed user-space value for this axis.

DefaultValue float

The default user-space value (selected when no variation is applied).

MaximumValue float

The maximum allowed user-space value for this axis.

IsHidden bool

true if the font designer flagged this axis as hidden (intended for internal use rather than direct user exposure). Hidden axes are typically still functional but should not be surfaced in a font-picker UI.

Remarks​

Variation axes are the design dimensions a variable font exposes — typical examples include wght (weight, 1..1000), wdth (width, percentage), opsz (optical size, points), ital (italic, 0..1), and slnt (slant, degrees).

Values are in user-space: the same values the font designer chose to expose to end users (e.g. weight 700 for "Bold"). The platform-neutral Avalonia.Media.FontVariationSettings also speaks user-space values; they are normalized into [-1, 1] through the font's fvar / avar tables per font when the settings are applied.

Methods​

NameDescription
DeconstructNo summary available.
Equals (2 overloads)No summary available.
GetHashCodeNo summary available.
ToStringNo summary available.

Deconstruct Method​

public void Deconstruct(Avalonia.Media.Fonts.OpenTypeTag& Tag, string& Name, float& MinimumValue, float& DefaultValue, float& MaximumValue, bool& IsHidden)

Parameters​

Tag Avalonia.Media.Fonts.OpenTypeTag&

Name string&

MinimumValue float&

DefaultValue float&

MaximumValue float&

IsHidden bool&

Equals overloads​

Equals Method​

public bool Equals(Avalonia.Media.FontVariationAxis other)
Parameters​

other Avalonia.Media.FontVariationAxis

Returns​

bool

Equals Method​

public bool Equals(object obj)
Parameters​

obj object

Returns​

bool

GetHashCode Method​

public int GetHashCode()

Returns​

int

ToString Method​

public string ToString()

Returns​

string

Properties​

NameDescription
DefaultValueThe default user-space value (selected when no variation is applied).
IsHiddentrue if the font designer flagged this axis as hidden (intended for internal use rather than direct user exposure). Hidden axes are typically still functional but should not be surfaced in a font-picker UI.
MaximumValueThe maximum allowed user-space value for this axis.
MinimumValueThe minimum allowed user-space value for this axis.
NameA human-readable axis name resolved from the font's name table. Falls back to the tag's string form when no name record is available.
TagThe four-character OpenType axis tag (e.g. wght).

DefaultValue Property​

The default user-space value (selected when no variation is applied).

public float DefaultValue { get; set; }

IsHidden Property​

true if the font designer flagged this axis as hidden (intended for internal use rather than direct user exposure). Hidden axes are typically still functional but should not be surfaced in a font-picker UI.

public bool IsHidden { get; set; }

MaximumValue Property​

The maximum allowed user-space value for this axis.

public float MaximumValue { get; set; }

MinimumValue Property​

The minimum allowed user-space value for this axis.

public float MinimumValue { get; set; }

Name Property​

A human-readable axis name resolved from the font's name table. Falls back to the tag's string form when no name record is available.

public string Name { get; set; }

Tag Property​

The four-character OpenType axis tag (e.g. wght).

public Avalonia.Media.Fonts.OpenTypeTag Tag { get; set; }