-
-
Notifications
You must be signed in to change notification settings - Fork 324
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
Add bold support for CJK characters #3069
base: main
Are you sure you want to change the base?
Conversation
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.
Can't you use a bold font?
Bloaty Results (iOS) 🐋Compared to main
Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results-ios/pr-3069-compared-to-main.txt |
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.
I don't think matching on the name is a good idea because fonts with 'bold' in the name tend to be bold already!
I think the proper way to implement this would be with a font-weight
style spec property. However, I think it's much easier to use a local or server font that is already bold.
I wasn't aware this is exactly what MapLibre Android and MapLibre GL JS do... |
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.
I added a test. Please take a look if it looks OK to you.
Also, please have a look at my comments. Thank you.
Benchmark Results ⚡
Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/benchmark-results/pr-3069-compared-to-main.txt |
Bloaty Results 🐋Compared to main
Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results/pr-3069-compared-to-main.txtCompared to d387090 (legacy)
Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results/pr-3069-compared-to-legacy.txt |
I find it peculiar that we need to figure out bold flag from the name, but change seems to reflect what Android does and fixes the bug. LTGM. |
Use system font family to draw characters of CJK, but don't support bold font on iOS. Add similar logic as Android side.