This PR adds support of ligatures in a way to keep default behavior/performance unchanged (using 2 render paths, with reusable code extracted into resolve_colors / composite_glyph).
Rendering of ligatures is indeed not trivial, and is indeed slower. Ligature rendering is cached by default, largest CPU sink is detection of what is ligature and what is not (only when ligatures are enabled).
I tried to keep code simple with minimal amount of memory allocations, so not everything that can be cached/reused is cached (especially as rendering is multithreaded). Personally though I do not notice any practical speed difference, and startup is still instant.
When we know it is 100% reliable and is not causing issues to any users - we can keep only liga code path by short-circuiting ligature detection when ligatures are disabled in unified code path. Currently dual render is kept separate to ensure 100% original behavior for non-liga mode.
For historical reference: #57
Adds tweak.ligatures option (default: no) for OpenType liga/calt
rendering with programming fonts. Ligatures are render-only —
the grid and copy/paste are unchanged.
Ligatures are rendered via new glyph-based API in fcft.
This PR adds support of ligatures in a way to keep default behavior/performance unchanged (using 2 render paths, with reusable code extracted into resolve_colors / composite_glyph).
Rendering of ligatures is indeed not trivial, and is indeed slower. Ligature rendering is cached by default, largest CPU sink is detection of what is ligature and what is not (only when ligatures are enabled).
I tried to keep code simple with minimal amount of memory allocations, so not everything that can be cached/reused is cached (especially as rendering is multithreaded). Personally though I do not notice any practical speed difference, and startup is still instant.
When we know it is 100% reliable and is not causing issues to any users - we can keep only liga code path by short-circuiting ligature detection when ligatures are disabled in unified code path. Currently dual render is kept separate to ensure 100% original behavior for non-liga mode.
For historical reference: https://codeberg.org/dnkl/foot/issues/57
---
Adds tweak.ligatures option (default: no) for OpenType liga/calt
rendering with programming fonts. Ligatures are render-only —
the grid and copy/paste are unchanged.
Ligatures are rendered via new glyph-based API in fcft.