Skip to content

Conversation

@SergioEstevao
Copy link
Contributor

This PR brings to TextView the following:

  • The possibility to replace the defaultFont being used after the TextView is created
  • Introduction of a FontProvider to allow configuration of fonts being used in the system
  • Configuration of the default font being used for monospace

To test:

  • Run the sample app
  • Check the demo content
  • There is new button on the top right (+) press it and see if the default font changes in all the demo content.

Instead of having random places where we obtain/configure fonts, this
commits creates a central class where fonts can be retrieved.
Copy link
Contributor

@etoledom etoledom left a 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:

Is this expected?
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? 😬

@SergioEstevao
Copy link
Contributor Author

@etoledom code updated ready for another look.

Copy link
Contributor

@etoledom etoledom left a 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 ✅

@SergioEstevao SergioEstevao merged commit 181ebc7 into develop Oct 9, 2019
@SergioEstevao SergioEstevao deleted the issue/allow_change_of_default_font branch October 9, 2019 11:45
@etoledom etoledom mentioned this pull request Oct 14, 2019
@SergioEstevao SergioEstevao modified the milestones: Next Stable, 1.11.0 Nov 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants