Unless you want ligatures.
for each character in text
characterToPrint = Parse(character)
if character is LigatureStartCandidate
characterToPrint = LookAheadForNextLigatureCandidateAndResolve(character)
Print(characterToPrint)The real challenge is Arabic, though, see https://fontspec.org/opentype-shaping/opentype-shaping-arabi...
> In typography, ligatures should be used in "truffle" but should not be used in "cufflink."
> This specific pair of words is a classic textbook example used by typographers and software developers to demonstrate the limitations of basic, automated font-rendering rules.
What a world to live in.
On the same point of yours, bad two-letter ligatures also exist: surfing (fi), selfless (fl), halftime (ft), etc. "Swordfish" is fine but "dwarfish" is not.