Skip to content

Instantly share code, notes, and snippets.

@byJeevan
Forked from zacwest/ios-font-sizes.swift
Created July 25, 2018 05:02
Show Gist options
  • Save byJeevan/9eb3498caa6b6a5573e927401c8d94d2 to your computer and use it in GitHub Desktop.
Save byJeevan/9eb3498caa6b6a5573e927401c8d94d2 to your computer and use it in GitHub Desktop.
iOS default font sizes
let styles: [UIFontTextStyle] = [
// 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)")
}
Style Font Size
.largeTitle SFUIDisplay 34.0
.title1 SFUIDisplay
(-Light on iOS <=10)
28.0
.title2 SFUIDisplay 22.0
.title3 SFUIDisplay 20.0
.headline SFUIText-Semibold 17.0
.callout SFUIText 16.0
.subheadline SFUIText 15.0
.body SFUIText 17.0
.footnote SFUIText 13.0
.caption1 SFUIText 12.0
.caption2 SFUIText 11.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment