-
Notifications
You must be signed in to change notification settings - Fork 149
Allow configuration of default fonts used in TextView #1221
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
Conversation
Instead of having random places where we obtain/configure fonts, this commits creates a central class where fonts can be retrieved.
etoledom
left a comment
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.
Thank you @SergioEstevao for this Improvement!
I tested as described and it works well.
But I noticed that the font changes in all the content that doesn't have any styling. Bold, Italic, heading, etc keeps its current font.
I did a test with a more obvious font:
This is Zapfino font. But it doesn't have Bold or Italic variant.
Also tested with Optima font that does have Bold and Italic variant and the result was the same.
One more thing: When I tested with Zapfino I got a crash here:
| return UIFont(descriptor: descriptor!, size: font.pointSize) |
It was quick fix by replacing the force unwrap with an if-let. But does it make sense that the will be nil given that font and traits are not nil? 😬
|
@etoledom code updated ready for another look. |
etoledom
left a comment
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.
Thank you for the update @SergioEstevao !
It's working great now 🎉
I left a code comment to think about, but everything looks great, so ✅

This PR brings to TextView the following:
To test: