Tincture.Font.OpenType.GSUB (Tincture v0.1.0)

Copy Markdown View Source

Parser for the OpenType GSUB table: glyph substitution.

Tincture reads two kinds of substitution:

  • ligatures (lookup type 4) - a sequence of glyphs replaced by one, which is how "fi" becomes a single glyph.
  • single substitutions (lookup type 1) - one glyph replaced by one other, used for small caps, oldstyle figures and similar stylistic sets.

Results are mapped back from glyph indices to codepoints via the cmap, so the typography layer can work in text rather than glyph ids.

Summary

Functions

parse_gsub_ligatures(data, table_records, cmap_by_code)

parse_gsub_ligatures_all_scripts(data, table_records, cmap_by_code)

parse_gsub_substitutions_all_scripts(data, table_records, cmap_by_code)