-
Notifications
You must be signed in to change notification settings - Fork 33
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.  Diffs= 3eefba5039 CoreText fallback shaper ex (#8568) Co-authored-by: David Skuza <[email protected]> Co-authored-by: Luigi Rosso <[email protected]>
- Loading branch information
1 parent
c9bed9a
commit ec1e05a
Showing
6 changed files
with
19 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
807f9b20ac7f040df6646b808bdb70ab84b7db57 | ||
3eefba5039d73329b31048b3bd839bfabc177bc0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule rive-runtime
updated
8 files
+1 −1 | .rive_head | |
+10 −1 | include/rive/text/font_hb.hpp | |
+3 −2 | include/rive/text_engine.hpp | |
+59 −15 | src/text/font_hb.cpp | |
+373 −7 | src/text/font_hb_apple.mm | |
+1 −0 | tests/unit_tests/premake5.lua | |
+7 −3 | tests/unit_tests/runtime/font_test.cpp | |
+6 −2 | viewer/src/viewer_content/text_content.cpp |