FontInstance Class
An instance of a variable font: a value for each axis, and what only depends on these values.
public sealed class FontInstanceRemarks
The scalars of the regions of each variation store are computed once, when the instance is created.
Properties
| Name | Description |
|---|---|
| Coordinates | Gets the normalized value of each axis, from -1 to 1, as 2.14 fixed-point numbers: the form of the variation tables. |
| UserCoordinates | Gets the value of each axis, in the units of the axis, as 16.16 fixed-point numbers. |
Coordinates
FontInstance.csGets the normalized value of each axis, from -1 to 1, as 2.14 fixed-point numbers: the form of the variation tables.
public ReadOnlySpan<int> Coordinates { get; }Property value
UserCoordinates
FontInstance.csGets the value of each axis, in the units of the axis, as 16.16 fixed-point numbers.
public ReadOnlySpan<int> UserCoordinates { get; }Property value
Methods
| Name | Description |
|---|---|
| Normalize(FontAxisRecord, int) | Normalizes the value of an axis: -1 at its minimum, 0 at its default, 1 at its maximum. OpenType specification, "Coordinate scales and normalization". |
| ToTableValue(int) | Converts a normalized 16.16 number to the 2.14 number of the variation tables, as the specification says: by adding 2 and dropping two bits. |
Normalize(FontAxisRecord, int)
FontInstance.csNormalizes the value of an axis: -1 at its minimum, 0 at its default, 1 at its maximum. OpenType specification, "Coordinate scales and normalization".
public static int Normalize(in FontAxisRecord axis, int value)Parameters
axisFontAxisRecord- The axis.
valueint- The value, as a 16.16 fixed-point number, within the range of the axis.
Returns
int The normalized value, as a 16.16 fixed-point number: the avar table of the font maps it with this precision, and FontInstance.ToTableValue then gives the 2.14 number the variation tables are compared with.
ToTableValue(int)
FontInstance.csConstants
| Name | Description |
|---|---|
| TableOne | The value 1 as a 2.14 fixed-point number: the largest normalized value of an axis. |
| TableShift | The number of bits between a 2.14 number and a 16.16 number. |
TableOne
The value 1 as a 2.14 fixed-point number: the largest normalized value of an axis.
public const int TableOne = 16384TableShift
The number of bits between a 2.14 number and a 16.16 number.
public const int TableShift = 2