PeachDrawing.Text

PeachDrawing.Text.Shaping.ShapeSettings

ShapeSettings Constructors

Overloads  
ShapeSettings() Creates the default settings: common and required ligatures, contextual alternates and kerning, and nothing else.
ShapeSettings(LigatureSet, CapsMode, NumeralSet, EastAsianSet, IReadOnlyList<FeatureSetting>, bool, string, string, IReadOnlyList<ArabicJoiningForm>, IReadOnlyList<UseCategory>, bool, SubSuperMode, EmojiMode, IReadOnlyList<KhmerCategory>) Everything a caller can ask of the shaper for one run of text.

ShapeSettings() Constructor

Creates the default settings: common and required ligatures, contextual alternates and kerning, and nothing else.

public ShapeSettings();

ShapeSettings(LigatureSet, CapsMode, NumeralSet, EastAsianSet, IReadOnlyList<FeatureSetting>, bool, string, string, IReadOnlyList<ArabicJoiningForm>, IReadOnlyList<UseCategory>, bool, SubSuperMode, EmojiMode, IReadOnlyList<KhmerCategory>) Constructor

Everything a caller can ask of the shaper for one run of text.

public ShapeSettings(PeachDrawing.Text.Shaping.LigatureSet Ligatures=PeachDrawing.Text.Shaping.LigatureSet.Default, PeachDrawing.Text.Shaping.CapsMode Caps=PeachDrawing.Text.Shaping.CapsMode.None, PeachDrawing.Text.Shaping.NumeralSet Numeric=PeachDrawing.Text.Shaping.NumeralSet.None, PeachDrawing.Text.Shaping.EastAsianSet EastAsian=PeachDrawing.Text.Shaping.EastAsianSet.None, System.Collections.Generic.IReadOnlyList<PeachDrawing.Text.Shaping.FeatureSetting>? ExplicitFeatures=null, bool Kerning=true, string? Language=null, string? ScriptTag=null, System.Collections.Generic.IReadOnlyList<PeachDrawing.Text.Unicode.ArabicJoiningForm>? JoiningForms=null, System.Collections.Generic.IReadOnlyList<PeachDrawing.Text.Unicode.UseCategory>? UseCategories=null, bool ReverseForDisplay=false, PeachDrawing.Text.Shaping.SubSuperMode Position=PeachDrawing.Text.Shaping.SubSuperMode.None, PeachDrawing.Text.Unicode.EmojiMode EmojiMode=PeachDrawing.Text.Unicode.EmojiMode.Normal, System.Collections.Generic.IReadOnlyList<PeachDrawing.Text.Unicode.KhmerCategory>? KhmerCategories=null);

Parameters

Ligatures LigatureSet

The ligature features to apply.

Caps CapsMode

The caps feature to apply.

Numeric NumeralSet

The numeral features to apply.

EastAsian EastAsianSet

The East Asian features to apply.

ExplicitFeatures System.Collections.Generic.IReadOnlyList<FeatureSetting>

Substitution (GSUB) features asked for by tag, or null for none. Positioning is not controlled this way: kerning is the Kerning setting.

Kerning System.Boolean

Whether to apply the font’s kerning.

Language System.String

A BCP 47 language tag that selects language-specific behaviour in the font, or null for none.

ScriptTag System.String

The OpenType script tag the run is in (see ForScript(string)), or null to let the font’s default script apply.

JoiningForms System.Collections.Generic.IReadOnlyList<ArabicJoiningForm>

For a run of a joining script, the positional form of each character, one for each code point, as Resolve(IReadOnlyList<int>) returns them; otherwise null.

UseCategories System.Collections.Generic.IReadOnlyList<UseCategory>

For a run of an Indic script, the Universal Shaping Engine category of each code point, as Classify(int) gives them; otherwise null.

ReverseForDisplay System.Boolean

Whether to reverse the shaped glyphs into visual order at the end, and replace mirrorable glyphs by their mirror images, for a run that is laid out right to left. The text the lookups ran over is never reversed. Reversing rewrites each glyph’s XOffset so that it stays in place, and leaves AttachedToIndex empty on every glyph of the reversed run.

Position SubSuperMode

The subscript or superscript feature to apply.

EmojiMode EmojiMode

Which presentation of a character with both a text and an emoji form to choose a glyph for, which is a cmap format 14 lookup and not a feature.

KhmerCategories System.Collections.Generic.IReadOnlyList<KhmerCategory>

For a Khmer run, HarfBuzz’s own (pre-Universal-Shaping-Engine) shaping category of each code point, as Classify(int) gives them; otherwise null.

Remarks

The requests fold into one, so the shaper can activate every lookup in a single pass in the order the font’s own lookup list gives. The typed groups (Ligatures, Caps, Numeric, EastAsian, Position) are kept apart from ExplicitFeatures because they carry precedence and alternate-selection rules that a list of tags cannot: a tag a typed group controls is always decided by that group, never by an explicit setting, which is CSS’s rule for font-variant-* over font-feature-settings.

JoiningForms, UseCategories and KhmerCategories are for a run of a joining script, an Indic script shaped by the Universal Shaping Engine, or Khmer respectively, and only one of the three is ever set for a run. The lists are compared by reference when settings are used as a cache key, so two equal lists that are separate objects cache separately, which costs a repeated lookup and never a wrong answer.

Write new ShapeSettings() or Default for the defaults; default(ShapeSettings) is all zeros and means no ligatures and no kerning.