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

Use UIFontMetrics to scale fonts #64

Merged
merged 1 commit into from
Jun 3, 2019
Merged

Conversation

davelyon
Copy link
Contributor

I saw your comment about the article I wrote in #52 and figured I had to take a quick stab at fixing that for you. 😄 Let me know if you'd like to see more tests, you can come up with a nicer name than scalingTextStyle, or if there is any documentation I should update.

On iOS 11 and up, use UIFontMetrics to scale font sizes. Falls back to
a calculation using the current content size category / large as a
multiplier.

Also adds the scalingTextStyle attribute to TextStyle with a default
value of body so that users may specify how they'd prefer to scale the
specific font.

This should not be a breaking change for anyone since it's an added
field with a default value. All tests still pass without adding this new
value anywhere.

On iOS 11 and up, use UIFontMetrics to scale font sizes. Falls back to
a calculation using the current content size category / large as a
multiplier.

Also adds the `scalingTextStyle` attribute to `TextStyle` with a default
value of `body` so that users may specify how they'd prefer to scale the
specific font.

This should not be a breaking change for anyone since it's an added
field with a default value. All tests still pass without adding this new
value anywhere.
@rnystrom
Copy link
Member

rnystrom commented Jun 3, 2019

This is so great, TIL! Sorry for the delay!

@rnystrom rnystrom merged commit 827164d into GitHawkApp:master Jun 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants