-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use system fonts as fallback. #68995
Conversation
158c0bb
to
cc990cb
Compare
cc990cb
to
6247eec
Compare
Performance seems to be pretty reasonable, font lookup takes about 100-1500 μs (every time text with the missing glyphs is shaped, Linux version is the slowest). Loading all fonts for the sample on the screenshot (6 to 10 fonts depending on OS) takes about 15000 μs on average. So should be fine for UI apps (or as fallback anywhere). |
78ba345
to
0727172
Compare
0727172
to
4e8febb
Compare
8839f59
to
3343ee2
Compare
platform/android/java/lib/src/org/godotengine/godot/io/StorageScope.kt
Outdated
Show resolved
Hide resolved
3343ee2
to
29a7216
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
There's a suggestion from KoBeWi for the new File API, to be discussed. Otherwise the rest should be good to merge.
platform/android/java/lib/src/org/godotengine/godot/io/StorageScope.kt
Outdated
Show resolved
Hide resolved
Add support for font weight and stretch selection when using system fonts. Add function to get system fallback font from a font name, style, text, and language code. Implement system font support for Android. Use system fonts as a last resort fallback.
29a7216
to
ecec415
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Android section looks good to me.
Thanks! |
I believe this changes "fontconfig" from optional to required on Linux. I'm not debugging my (build) system today. |
It should not, but I think I have missed |
Nice feature. |
System font support relies on a lot of backwards-incompatible TextServer changes, so it's not possible to backport this feature to 3.x without a complete rewrite. |
OS.get_system_font_path_for_text
).Implemented on Android, iOS, Linux (fontconfig required), macOS, and Windows.
For the reference: Implementing it for Web is only possible with https://wicg.github.io/local-font-access/ (draft proposal, not supported by anything).
Test Project:
FontSelect.zip