LayoutTable Class
The structure the GSUB and GPOS tables share: scripts, language systems, features and lookups. OpenType specification, "OpenType Layout Common Table Formats".
public sealed class LayoutTableRemarks
The header is validated when the table is read; everything else is validated when it is used, and a reference outside the table is an InvalidFontException.
Methods
| Name | Description |
|---|---|
| FindFeature(ReadOnlySpan<byte>, uint) | Finds the first feature of the feature list that has a tag, whatever the scripts and the language systems that list it. |
| FindFeatureSubstitutions(ReadOnlySpan<byte>, ReadOnlySpan<int>) | Finds the feature substitutions that apply to an instance of a variable font: "FeatureVariations table". The first record whose conditions all hold is the one that applies. |
| FindLanguageSystem(ReadOnlySpan<byte>, ReadOnlySpan<uint>, ReadOnlySpan<uint>) | Finds the language system of a script and a language. |
| FindScriptTag(ReadOnlySpan<byte>, ReadOnlySpan<uint>) | Finds the tag the table has for a script: the first of the tags of the script it has, or 0. |
| GetFeatureCount(ReadOnlySpan<byte>, int) | Gets the number of features of a language system. |
| GetFeatureIndex(ReadOnlySpan<byte>, int, int) | Gets the index, in the feature list, of a feature of a language system. |
| GetFeatureListCount(ReadOnlySpan<byte>) | Gets the number of features of the feature list. |
| GetFeatureLookup(ReadOnlySpan<byte>, int, int, int) | Gets a lookup of a feature of the feature list. |
| GetFeatureLookupCount(ReadOnlySpan<byte>, int, int) | Gets the number of lookups of a feature of the feature list. |
| GetFeatureTag(ReadOnlySpan<byte>, int) | Gets the tag of a feature of the feature list, or 0 when the index is not one of its features. |
| GetLookupCount(ReadOnlySpan<byte>) | Gets the number of lookups. |
| GetRequiredFeature(ReadOnlySpan<byte>, int) | Gets the feature a language system requires, or LayoutTable.NoFeature. |
| Read(ReadOnlySpan<byte>) | Reads the header of a GSUB or GPOS table. |
FindFeature(ReadOnlySpan<byte>, uint)
LayoutTable.csFinds the first feature of the feature list that has a tag, whatever the scripts and the language systems that list it.
public int FindFeature(ReadOnlySpan<byte> table, uint tag)Parameters
tableReadOnlySpan<byte>taguint
Returns
int The index of the feature in the feature list, or LayoutTable.NoFeature.
FindFeatureSubstitutions(ReadOnlySpan<byte>, ReadOnlySpan<int>)
LayoutTable.csFinds the feature substitutions that apply to an instance of a variable font: "FeatureVariations table". The first record whose conditions all hold is the one that applies.
public int FindFeatureSubstitutions(ReadOnlySpan<byte> table, ReadOnlySpan<int> coordinates)Parameters
tableReadOnlySpan<byte>- The table.
coordinatesReadOnlySpan<int>- The normalized coordinates of the instance, as 2.14 fixed-point numbers; an axis without coordinate is at its default.
Returns
int The position of the feature table substitution, or 0 when no feature is replaced.
FindLanguageSystem(ReadOnlySpan<byte>, ReadOnlySpan<uint>, ReadOnlySpan<uint>)
LayoutTable.csFinds the language system of a script and a language.
public int FindLanguageSystem(ReadOnlySpan<byte> table, ReadOnlySpan<uint> scripts, ReadOnlySpan<uint> languages)Parameters
tableReadOnlySpan<byte>- The table.
scriptsReadOnlySpan<uint>- The tags of the script, by order of preference.
languagesReadOnlySpan<uint>- The tags of the language, by order of preference; the default language system of the script is used when the script has none of them, or when there is no tag.
Returns
int The position of the language system, or 0 when the table has none for the script.
FindScriptTag(ReadOnlySpan<byte>, ReadOnlySpan<uint>)
LayoutTable.csFinds the tag the table has for a script: the first of the tags of the script it has, or 0.
public uint FindScriptTag(ReadOnlySpan<byte> table, ReadOnlySpan<uint> scripts)Parameters
tableReadOnlySpan<byte>- The table.
scriptsReadOnlySpan<uint>- The tags of the script, by order of preference.
Returns
GetFeatureCount(ReadOnlySpan<byte>, int)
LayoutTable.csGets the number of features of a language system.
public static int GetFeatureCount(ReadOnlySpan<byte> table, int languageSystem)GetFeatureIndex(ReadOnlySpan<byte>, int, int)
LayoutTable.csGets the index, in the feature list, of a feature of a language system.
public static int GetFeatureIndex(ReadOnlySpan<byte> table, int languageSystem, int index)GetFeatureListCount(ReadOnlySpan<byte>)
LayoutTable.csGets the number of features of the feature list.
public int GetFeatureListCount(ReadOnlySpan<byte> table)GetFeatureLookup(ReadOnlySpan<byte>, int, int, int)
LayoutTable.csGetFeatureLookupCount(ReadOnlySpan<byte>, int, int)
LayoutTable.csGets the number of lookups of a feature of the feature list.
public int GetFeatureLookupCount(ReadOnlySpan<byte> table, int feature, int substitutions = 0)Parameters
tableReadOnlySpan<byte>- The table.
featureint- The index of the feature in the feature list.
substitutionsint- The feature substitutions of the instance, from
LayoutTable.FindFeatureSubstitutions, or 0.
Returns
GetFeatureTag(ReadOnlySpan<byte>, int)
LayoutTable.csGets the tag of a feature of the feature list, or 0 when the index is not one of its features.
public uint GetFeatureTag(ReadOnlySpan<byte> table, int feature)GetLookupCount(ReadOnlySpan<byte>)
LayoutTable.csGets the number of lookups.
public int GetLookupCount(ReadOnlySpan<byte> table)GetRequiredFeature(ReadOnlySpan<byte>, int)
LayoutTable.csGets the feature a language system requires, or LayoutTable.NoFeature.
public static int GetRequiredFeature(ReadOnlySpan<byte> table, int languageSystem)Read(ReadOnlySpan<byte>)
LayoutTable.csReads the header of a GSUB or GPOS table.
public static LayoutTable? Read(ReadOnlySpan<byte> table)Parameters
tableReadOnlySpan<byte>
Returns
LayoutTable? The table, or null when its version is not known or it has no lookup: the font is then used without it.
Constants
| Name | Description |
|---|---|
| NoFeature | The index of a feature that is not required: a language system that has no required feature. |
NoFeature
The index of a feature that is not required: a language system that has no required feature.
public const int NoFeature = 65535