-
-
Notifications
You must be signed in to change notification settings - Fork 573
Description
I think I have found details for how to solve font fallback for real this time rather than requiring users to manually specify the fallback list.
https://zachbayl.in/blog/font-fallback-revery.html
This blog post highlights the strategy. Turns out skia (cause of course it does) has a font fallback implementation which works cross platform. It handles fallback by returning a font which is guaranteed to render a give character. So the strategy is that we shape the text getting cluster divides, then loop over every cluster looking for glyphs with id 0. For each of those we query skia for the correct fallback character, load it up, and requery harfbuzz for a new cluster list. Rinse repeat until all the glyphs have ids.
Along with this I discovered https://github.com/RazrFalcon/rustybuzz which looks to have a reasonable and rusty api for shaping which should be equivalent to harfbuzz' implementation. So I plan to incorporate that.
Lastly while I'm in this area, I'd like to cut down on dependencies, so I want to take another stab at using skia's font parsing/metrics rather than font-kit's. By removing both font-kit and skribo I should be able to cut out a TON of dependencies which will result in smaller exe size and faster build times. win win
For now I'm going to comb through all the issues and close any related to font fallback and point them to this issue as this is where development will happen.