Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More experimenting on top of https://github.com/rive-app/rive/pull/8556 This breaks some APIs that still need to be fixed up elsewhere. The basic concept here is that when you request a system font you can tell it whether you're requesting to use it a Harfbuzz shaped system font or a CoreText (System) shaped system font. We prioritize Harfbuzz first so that we have predictable performance and results across edit and runtime. To do this the fallback process now comes with an index. Iteration will keep happening until no font is returned (or all glyphs are found). If the registered fallbacks look like this: ``` RiveFont.fallbackFonts = [ UIFont(name: "PingFangSC-Semibold", size: 12)!, UIFont(name: "Hiragino Sans", size: 12)! ] ``` The fallback process will return: ``` iter 0: Ping Fang Harfbuzz Shaped iter 1: Hiragino San Harfbuzz Shaped iter 2: Ping Fang Coretext Shaped iter 3: Hiragino Sans Coretext Shaped ``` We also use Coretext last as usually shaping with Coretext causes Apple's shaper to do its own fallbacks (it calls them cascades like css). So iter 2 (in the example above) will be the final iteration as all glyphs get filled via Apple's own fallbacks. ![CleanShot 2024-11-14 at 21 16 55@2x](https://github.com/user-attachments/assets/c12e158b-5b8e-41d4-8d9b-8184a316a079) Diffs= 3eefba5039 CoreText fallback shaper ex (#8568) Co-authored-by: David Skuza <[email protected]> Co-authored-by: Luigi Rosso <[email protected]>
- Loading branch information