Skip to content
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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

wangyingfang
Copy link
Collaborator

Use system font family to draw characters of CJK, but don't support bold font on iOS. Add similar logic as Android side.
image
image

Copy link
Collaborator

@louwers louwers left a 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?

Copy link

github-actions bot commented Dec 5, 2024

Bloaty Results (iOS) 🐋

Compared to main

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%    +176  [ = ]       0    TOTAL

Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results-ios/pr-3069-compared-to-main.txt

Copy link
Collaborator

@louwers louwers left a 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.

@louwers
Copy link
Collaborator

louwers commented Dec 5, 2024

I wasn't aware this is exactly what MapLibre Android and MapLibre GL JS do...

Copy link
Collaborator

@louwers louwers left a 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.

@louwers louwers requested a review from random3940 December 6, 2024 15:17
Copy link

github-actions bot commented Dec 6, 2024

Benchmark Results ⚡

Benchmark                                                     Time             CPU      Time Old      Time New       CPU Old       CPU New
------------------------------------------------------------------------------------------------------------------------------------------
OVERALL_GEOMEAN                                            +0.0121         +0.0120             0             0             0             0

Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/benchmark-results/pr-3069-compared-to-main.txt

Copy link

github-actions bot commented Dec 6, 2024

Bloaty Results 🐋

Compared to main

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  [ = ]       0  [ = ]       0    TOTAL

Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results/pr-3069-compared-to-main.txt

Compared to d387090 (legacy)

    FILE SIZE        VM SIZE    
 --------------  -------------- 
   +30% +34.6Mi  +432% +25.8Mi    TOTAL

Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results/pr-3069-compared-to-legacy.txt

@random3940
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants