Elektrine lite

← Feed

@khaled@typo.social

Post #1511913

2026-03-07 14:26 UTC

However, #Fontra does not generate positioning feature code during live preview, as it does the glyph positioning itself, while the rest of the shaping is done by #HarfBuzz (as explained in the blogpost). So how would it do this emulation in the middle of lookup application by HarfBuzz? HarfBuzz has a so-called message callback that allows caller to get a message about what HarfBuzz is doing and the HarfBuzz glyph buffer before each shaping step (this is what https://www.corvelsoftware.co.uk/crowbar/ uses to debug OpenType layout).

Replies (1)

  • @khaled@typo.social 2026-03-07 14:29

    Here comes the neat trick; #Fontra registers a message callback function, which gets called before and after each lookup is applied, and whenever #HarfBuzz is about to apply a lookup that the generated code would have been inserted before, Fontra steps in and modifies the glyph buffer and apply its own positioning logic. Then later lookups will be applied by HarfBuzz and modify the glyph positions as it would have happened with a fully compiled font. OK, it is a super nerdy and maybe a very few people can get why I’m so excited about it, but I’m really proud about it.

    Open ##1511914