There are a lot of resources out there for how to get started with Dynamic Type Sizes in iOS such as Apple, Big Nerd Ranch, Natasha, and libraries like Gliphy. This is more of a reference for myself when using the preferredFont(forTextStyle: ).pointSize
for adjusting custom fonts.
These sizes were all the “default” settings on iOS when resetting a simulator.
TextStyle | Family | Weight | Style | Size |
---|---|---|---|---|
.title1 | SFUIDisplay-Light | normal | normal | 28 |
.title2 | SFUIDisplay | normal | normal | 22 |
.title3 | SFUIDisplay | normal | normal | 20 |
.headline | SFUIText-Semibold | bold | normal | 17 |
.subheadline | SFUIText | normal | normal | 15 |
.body | SFUIText | normal | normal | 17 |
.callout | SFUIText | normal | normal | 16 |
.footnote | SFUIText | normal | normal | 13 |
.caption1 | SFUIText | normal | normal | 12 |
.caption2 | SFUIText | normal | normal | 11 |
So lets say your main title
style calls for a font of size 40 but you want it to scale with the user’s preferred sizes - you could just take preferredFont(forTextStyle: .title3).pointSize
and multiple it by 2.
Make your designer happy and make your users happy all while being accessible.