TextShaping Class

Definition

How text is shaped into glyphs before it is shown: the OpenType script and language system whose features apply, the run's direction, and which features are on. Immutable; each With* method returns a changed copy. Two instances with the same settings are equal.

public sealed class TextShaping : IEquatable<TextShaping>

Remarks

OpenType specification, "GSUB — Glyph Substitution Table", "GPOS — Glyph Positioning Table", "kern" and "OpenType Layout Common Table Formats" (ScriptList, LangSys, FeatureList), and the Feature Tags registry. Shaping applies the font's GSUB lookups for the default features ccmp, locl, rlig, rclt, calt, liga and clig, and, for Arabic, the joining forms isol, fina, medi and init chosen by the Unicode cursive joining rules; kern (also on by default) adds the font's pair kerning (its GPOS pair adjustments, else its kern table), and the GPOS features mark, mkmk, curs, dist, abvm and blwm (on by default) place marks on their bases and join cursive glyphs. WithFeature(String, Boolean) turns any of these off or another feature (such as smcp, dlig or salt, taking its first alternate) on.

The text of a run is one script in one direction: a right-to-left run (Arabic, Hebrew) is shaped in logical order and its glyphs are shown in visual order, right to left. Splitting mixed text into runs is bidirectional layout's job (issue #173). Indic, Southeast Asian and the other complex scripts are not shaped beyond the default features (issue #230).

Tip: use kind:method, kind:property, kind:ctor. Press Esc to clear.

Properties (5)

Methods (8)