Comment by anonymous908213

6 hours ago

Do you really believe the only way to implement ligatures is with a virtual machine? Dumb and dirty psuedocode written in 5 seconds of thinking about it but come on, this is not that complicated.

  for each character in text
    characterToPrint = Parse(character)
    if character is LigatureStartCandidate
      characterToPrint = LookAheadForNextLigatureCandidateAndResolve(character)
    Print(characterToPrint)

And you've now gotten 92% of the way there. Iterate a few dozen more times to get up to 97%, 98%, 99%, etc., and eventually you'll have rewritten OpenType.

  • Would you like to elaborate on those few dozen more cases rather than handwaving them away? Embedding a VM into a font format is foundationally a ridiculous idea and should require real justification, although I know our industry is in love with anything that allows arbitrary code execution exploits.

    • I could, or you could open your mind to the idea that the reason opentype wound up being as complex as it is is because the problem space you’re trying to solve is more complicated than you think it is. There is a working reference implementation which does the thing you think can be done more cheaply, you’re just throwing popcorn from the cheap seats here.