TextShaper
in package
FinalYes
Simple text shaper for Latin ligature substitution.
Given a GID sequence, applies GSUB ligature rules to produce the shaped GID sequence. This is NOT a full shaping engine — it handles standard Latin ligatures (fi, fl, ffi, ffl, etc.) but does not support Arabic joining, Indic reordering, mark positioning, or other complex script features.
Table of Contents
Methods
- applyLigatures() : array<string|int, int>
- Apply ligature substitutions to a GID sequence.
Methods
applyLigatures()
Apply ligature substitutions to a GID sequence.
public
static applyLigatures(array<string|int, int> $gids, array<int, array<int, array{components: int[], ligature: int}>> $ligatures) : array<string|int, int>
Parameters
- $gids : array<string|int, int>
-
Input glyph IDs
- $ligatures : array<int, array<int, array{components: int[], ligature: int}>>
-
Ligature rules from GsubParser, keyed by first GID
Return values
array<string|int, int> —Shaped glyph IDs (may be shorter if ligatures were applied)