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

Wrong font when using NSParagraphStyle on ASTextNode in iOS 13 #1659

Closed
sgrgrsn opened this issue Sep 6, 2019 · 3 comments
Closed

Wrong font when using NSParagraphStyle on ASTextNode in iOS 13 #1659

sgrgrsn opened this issue Sep 6, 2019 · 3 comments

Comments

@sgrgrsn
Copy link

sgrgrsn commented Sep 6, 2019

I have a problem with my ASTextNode when building with the latest beta of Xcode 11 (beta 6) on the latest beta of iOS 13.1 (beta 2), and the one bundled with the Xcode 11 simulator.

I set up my attributed string like this:

let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.alignment = .center

textNode.attributedText = NSAttributedString(
    string: "Hello world!\nHow are you doing?",
    attributes: [
        NSAttributedString.Key.font: UIFont.systemFont(ofSize: 32, weight: .bold),
        NSAttributedString.Key.paragraphStyle: paragraphStyle,
    ]
)

It shows up as a serif font, and not the San Francisco font. If I choose to remove the paragraphStyle attributes from the string it shows up correctly as the San Francisco font, but then I'm not able to set alignment, line heights etc.

With the paragraphStyle attributes:
Simulator 2019-09-06 at 14 26 21

Without the paragraphStyle attributes:
Simulator 2019-09-06 at 14 27 07

I've tried on both my device and on the simulator and it gives the same result. There's no problems when building to an iOS 12 device/simulator.

Hope you can help me out.

Thanks in advance.

Info

Texture version: 2.8.1 (installed with CocoaPods v1.7.3)
Xcode version: 11.0 beta 6
iOS version (simulator): 13.0 (bundled with Xcode 11 beta 6)
iOS version (device): 13.1 beta 2
Sample project:
FontXcode11-Sample.zip

@jeffersonsetiawan
Copy link

I think #1579 fixes this issue

@sgrgrsn
Copy link
Author

sgrgrsn commented Sep 9, 2019

It seems like it's the same problem - thanks 👍

@nikmun
Copy link

nikmun commented Nov 4, 2019

I am facing the same issue. When will you guys release the new version with the fix of this issue?

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

3 participants