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

Default font changes in Xcode 11 #33

Open
sevgjan opened this issue Oct 2, 2019 · 3 comments
Open

Default font changes in Xcode 11 #33

sevgjan opened this issue Oct 2, 2019 · 3 comments

Comments

@sevgjan
Copy link

sevgjan commented Oct 2, 2019

Hi all,
Why it switches to TimesNewRomanPSMT font in Xcode 11?

Thanks

@sevgjan sevgjan changed the title Font changes in Xcode 11 Default font changes in Xcode 11 Oct 2, 2019
@evermeer
Copy link
Owner

evermeer commented Oct 3, 2019

AttributedTextView does not change any attributes by itself. It just takes the UILable, UITextview or NSAttributed text and applies whatever you specified. Indeed Apple made some changes in Xcode 11

As per Apple's official document https://developer.apple.com/fonts/

SF Pro:

This sans-serif typeface is the system font for iOS, macOS, and tvOS, and includes a rounded variant. It provides a consistent, legible, and friendly typographic voice.

SF Compact:

This sans-serif typeface is the system font for watchOS, and includes a rounded variant. It suits a wide range of content and is easily legible in a variety of contexts.

So we need to download and install SF Pro font and set UILabel attributed string font style with SF Pro Text Regular 18.0 to keep the same font style like Plain text have.

@sevgjan
Copy link
Author

sevgjan commented Oct 11, 2019

Quick update
In Attributer.swift I was changing:
open func font(_ font: UIFont?) -> Attributer { if font != nil { return fontName(font!.fontName.replacingOccurrences(of: ".", with: "")).size(font!.pointSize) } return self }
without the dot (.) and it worked for font, it was not changing to TimesNewRoman, but it's not working for font-weight.

cddjr added a commit to cddjr/AttributedTextView that referenced this issue Sep 30, 2020
@evgeniy-bizhanov
Copy link

evgeniy-bizhanov commented May 20, 2021

still replaces for me
see so https://stackoverflow.com/questions/59105193/asking-for-san-francisco-font-in-different-size-returns-a-times-new-roman-varian
seems fontFamily should be used instead fontName

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