= Glyph substitution
<Glyph substitution> replaces selected <glyph indices> by other <glyph indices> while laying out text. In <OpenType>, the GSUB table specifies these replacements after the default character-to-<glyph index> mapping. A substitution can replace one <glyph> by another, several by a <typographic ligature>, or one by several; its application can depend on surrounding <glyphs>.<Glyph Substitution Table by Microsoft>[Overview and Lookup Types1–6: input/output glyph indices, ligatures and contextual substitution]{ref}
For a hypothetical <computer font>, suppose `f` and `i` initially select indices17 and23. A matching ligature rule could replace the pair by index91. These numbers belong to that particular <computer font>; they do not change the stored <Unicode> sequence into <code point>91. The example also shows why substitution differs from <kerning>: replacing the pair selects a new shape, whereas adjusting the pair's positions can retain both original shapes.
Lookup order matters when one substitution creates or removes the input pattern for a later substitution. <Text shaping> must therefore interpret the applicable <OpenType> rules, rather than independently choosing a default <glyph> for each <text character>.
Back to article page