Style | Font | Size |
---|---|---|
.largeTitle | SFUI-Regular | 34.0 |
.title1 | SFUI-Regular | 28.0 |
.title2 | SFUI-Regular | 22.0 |
.title3 | SFUI-Regular | 20.0 |
.headline | SFUI-Semibold | 17.0 |
.callout | SFUI-Regular | 16.0 |
.subheadline | SFUI-Regular | 15.0 |
.body | SFUI-Regular | 17.0 |
.footnote | SFUI-Regular | 13.0 |
.caption1 | SFUI-Regular | 12.0 |
.caption2 | SFUI-Regular | 11.0 |
let styles: [UIFont.TextStyle] = [ | |
// iOS 11 | |
.largeTitle, | |
// iOS 9 | |
.title1, .title2, .title3, .callout, | |
// iOS 7 | |
.headline, .subheadline, .body, .footnote, .caption1, .caption2, | |
] | |
for style in styles { | |
let font = UIFont.preferredFont(forTextStyle: style) | |
print("\(style): \(font.fontName) @ \(font.pointSize)") | |
} |
Thank you!
I am guessing these results are from running the code with the default user font preferences?
@NikolaKirev Correct, this is just at the default dynamic type size. You can see a graph of what happens to the type sizes in this graph.
what are the font sizes for iPad?
I think when considering accessibilities this won't be the correct size anymore.
Useful... Thanks
Usefu! Thanks!
is WatchOS different? On WatchOS .footnote seems to be smaller than .caption and .caption2
Thank you for posting this.
Thank you @gesabo for the link. Here is those values for iOS https://developer.apple.com/design/human-interface-guidelines/ios/visual-design/typography#dynamic-type-sizes
This is very useful!
Thanks👍
This is useful documentation :)