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

ASTextNode does not render Japanese font correctly. (It misuse serif fonts) #1655

Closed
muukii opened this issue Sep 2, 2019 · 4 comments
Closed

Comments

@muukii
Copy link
Contributor

muukii commented Sep 2, 2019

On iOS13, ASTextNode does not render the Japanese font correctly,
Especially, We can see this problem with specified font and linebreak mode.

    let node = ASTextNode()
    
    let paragraph = NSMutableParagraphStyle()
    
    paragraph.lineBreakMode = .byCharWrapping
        
    node.attributedText = NSAttributedString(
      string: "こんにちは",
      attributes: [
        NSAttributedString.Key.font : UIFont.boldSystemFont(ofSize: 18),
        NSAttributedString.Key.foregroundColor : UIColor.init(white: 0.8, alpha: 1),
        NSAttributedString.Key.paragraphStyle : paragraph,
      ]
    )

image

The rendered font is wrong.
Followings is correct.

image

I think to set lineBreakMode causes this problem.
If I drop setting for lineBreakMode, ASTextNode will render correct font.

Additionally, ASTextNode2 does not have this problem. It works fine.

What's the problem?
Should I use ASTextNode2?

I attach reproduce project file.
iOS13-Text.zip

@muukii muukii changed the title ASTextNode does not render Japanese font correctly. (Misused serif fonts) ASTextNode does not render Japanese font correctly. (It misuse serif fonts) Sep 2, 2019
@jeffersonsetiawan
Copy link

jeffersonsetiawan commented Sep 3, 2019

I got this problem too even in the alphabet words. If I remove NSAttributedString.Key.paragraphStyle, it works as expected.

I am curious how to solve this too.

When I tried to use a custom font, it shows the correct custom font.

@jeffersonsetiawan
Copy link

I think #1579 fixes this issue

@muukii
Copy link
Contributor Author

muukii commented Sep 20, 2019

wow, I'll try to use on master branch

@muukii
Copy link
Contributor Author

muukii commented Oct 10, 2019

It seems to be fixed.

@muukii muukii closed this as completed Oct 10, 2019
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

No branches or pull requests

2 participants