Forked from nuthatch/iOS 7 dynamic font mappings
Last active
August 29, 2015 14:27
-
-
Save stevemoser/1cba38f1a673473e8d46 to your computer and use it in GitHub Desktop.
What is UIFontTextStyleHeadline *really*? Dump out preferredFontForTextStyle for UIFontTextStyleHeadline, UIFontTextStyleSubheadline, UIFontTextStyleBody, UIFontTextStyleFootnote, UIFontTextStyleCaption1, UIFontTextStyleCaption2 to examine the font name, weight, and point size.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| + (void)describePreferredFonts | |
| { | |
| static NSArray *textStyles; | |
| static dispatch_once_t onceToken; | |
| dispatch_once(&onceToken, ^{ | |
| textStyles = @[UIFontTextStyleHeadline, | |
| UIFontTextStyleSubheadline, | |
| UIFontTextStyleBody, | |
| UIFontTextStyleFootnote, | |
| UIFontTextStyleCaption1, | |
| UIFontTextStyleCaption2]; | |
| }); | |
| NSLog(@"\n%@", [self preferredContentSizeDescription]); | |
| for (NSString *textStyle in textStyles) | |
| { | |
| UIFont *font = [UIFont preferredFontForTextStyle:textStyle]; | |
| NSLog(@"\n%@\n%@ %@", textStyle, font.fontName, font); | |
| } | |
| } | |
| Extra Small | |
| UIFontTextStyleHeadline | |
| font-family: ".HelveticaNeueInterface-MediumP4"; font-weight: bold; font-style: normal; font-size: 14.00pt | |
| UIFontTextStyleSubhead | |
| font-family: ".HelveticaNeueInterface-M3"; font-weight: normal; font-style: normal; font-size: 12.00pt | |
| UIFontTextStyleBody | |
| font-family: ".HelveticaNeueInterface-M3"; font-weight: normal; font-style: normal; font-size: 14.00pt | |
| UIFontTextStyleFootnote | |
| font-family: ".HelveticaNeueInterface-M3"; font-weight: normal; font-style: normal; font-size: 12.00pt | |
| UIFontTextStyleCaption1 | |
| font-family: ".HelveticaNeueInterface-M3"; font-weight: normal; font-style: normal; font-size: 11.00pt | |
| UIFontTextStyleCaption2 | |
| font-family: ".HelveticaNeueInterface-M3"; font-weight: normal; font-style: normal; font-size: 11.00pt | |
| Small | |
| UIFontTextStyleHeadline | |
| font-family: ".HelveticaNeueInterface-MediumP4"; font-weight: bold; font-style: normal; font-size: 15.00pt | |
| UIFontTextStyleSubhead | |
| font-family: ".HelveticaNeueInterface-M3"; font-weight: normal; font-style: normal; font-size: 13.00pt | |
| UIFontTextStyleBody | |
| font-family: ".HelveticaNeueInterface-M3"; font-weight: normal; font-style: normal; font-size: 15.00pt | |
| UIFontTextStyleFootnote | |
| font-family: ".HelveticaNeueInterface-M3"; font-weight: normal; font-style: normal; font-size: 12.00pt | |
| UIFontTextStyleCaption1 | |
| font-family: ".HelveticaNeueInterface-M3"; font-weight: normal; font-style: normal; font-size: 11.00pt | |
| UIFontTextStyleCaption2 | |
| font-family: ".HelveticaNeueInterface-M3"; font-weight: normal; font-style: normal; font-size: 11.00pt | |
| Medium | |
| UIFontTextStyleHeadline | |
| font-family: ".HelveticaNeueInterface-MediumP4"; font-weight: bold; font-style: normal; font-size: 16.00pt | |
| UIFontTextStyleSubhead | |
| font-family: ".HelveticaNeueInterface-M3"; font-weight: normal; font-style: normal; font-size: 14.00pt | |
| UIFontTextStyleBody | |
| font-family: ".HelveticaNeueInterface-M3"; font-weight: normal; font-style: normal; font-size: 16.00pt | |
| UIFontTextStyleFootnote | |
| font-family: ".HelveticaNeueInterface-M3"; font-weight: normal; font-style: normal; font-size: 12.00pt | |
| UIFontTextStyleCaption1 | |
| font-family: ".HelveticaNeueInterface-M3"; font-weight: normal; font-style: normal; font-size: 11.00pt | |
| UIFontTextStyleCaption2 | |
| font-family: ".HelveticaNeueInterface-M3"; font-weight: normal; font-style: normal; font-size: 11.00pt | |
| Large | |
| UIFontTextStyleHeadline | |
| font-family: ".HelveticaNeueInterface-MediumP4"; font-weight: bold; font-style: normal; font-size: 17.00pt | |
| UIFontTextStyleSubhead | |
| font-family: ".HelveticaNeueInterface-M3"; font-weight: normal; font-style: normal; font-size: 15.00pt | |
| UIFontTextStyleBody | |
| font-family: ".HelveticaNeueInterface-M3"; font-weight: normal; font-style: normal; font-size: 17.00pt | |
| UIFontTextStyleFootnote | |
| font-family: ".HelveticaNeueInterface-M3"; font-weight: normal; font-style: normal; font-size: 13.00pt | |
| UIFontTextStyleCaption1 | |
| font-family: ".HelveticaNeueInterface-M3"; font-weight: normal; font-style: normal; font-size: 12.00pt | |
| UIFontTextStyleCaption2 | |
| font-family: ".HelveticaNeueInterface-M3"; font-weight: normal; font-style: normal; font-size: 11.00pt | |
| Extra Large | |
| UIFontTextStyleHeadline | |
| font-family: ".HelveticaNeueInterface-MediumP4"; font-weight: bold; font-style: normal; font-size: 18.00pt | |
| UIFontTextStyleSubhead | |
| font-family: ".HelveticaNeueInterface-M3"; font-weight: normal; font-style: normal; font-size: 16.00pt | |
| UIFontTextStyleBody | |
| font-family: ".HelveticaNeueInterface-M3"; font-weight: normal; font-style: normal; font-size: 18.00pt | |
| UIFontTextStyleFootnote | |
| font-family: ".HelveticaNeueInterface-M3"; font-weight: normal; font-style: normal; font-size: 14.00pt | |
| UIFontTextStyleCaption1 | |
| font-family: ".HelveticaNeueInterface-M3"; font-weight: normal; font-style: normal; font-size: 13.00pt | |
| UIFontTextStyleCaption2 | |
| font-family: ".HelveticaNeueInterface-M3"; font-weight: normal; font-style: normal; font-size: 12.00pt | |
| Extra Extra Large | |
| UIFontTextStyleHeadline | |
| font-family: ".HelveticaNeueInterface-MediumP4"; font-weight: bold; font-style: normal; font-size: 19.00pt | |
| UIFontTextStyleSubhead | |
| font-family: ".HelveticaNeueInterface-M3"; font-weight: normal; font-style: normal; font-size: 17.00pt | |
| UIFontTextStyleBody | |
| font-family: ".HelveticaNeueInterface-M3"; font-weight: normal; font-style: normal; font-size: 19.00pt | |
| UIFontTextStyleFootnote | |
| font-family: ".HelveticaNeueInterface-M3"; font-weight: normal; font-style: normal; font-size: 15.00pt | |
| UIFontTextStyleCaption1 | |
| font-family: ".HelveticaNeueInterface-M3"; font-weight: normal; font-style: normal; font-size: 14.00pt | |
| UIFontTextStyleCaption2 | |
| font-family: ".HelveticaNeueInterface-M3"; font-weight: normal; font-style: normal; font-size: 13.00pt | |
| Extra Extra Extra Large | |
| UIFontTextStyleHeadline | |
| font-family: ".HelveticaNeueInterface-MediumP4"; font-weight: bold; font-style: normal; font-size: 20.00pt | |
| UIFontTextStyleSubhead | |
| font-family: ".HelveticaNeueInterface-M3"; font-weight: normal; font-style: normal; font-size: 18.00pt | |
| UIFontTextStyleBody | |
| font-family: ".HelveticaNeueInterface-M3"; font-weight: normal; font-style: normal; font-size: 20.00pt | |
| UIFontTextStyleFootnote | |
| font-family: ".HelveticaNeueInterface-M3"; font-weight: normal; font-style: normal; font-size: 16.00pt | |
| UIFontTextStyleCaption1 | |
| font-family: ".HelveticaNeueInterface-M3"; font-weight: normal; font-style: normal; font-size: 15.00pt | |
| UIFontTextStyleCaption2 | |
| font-family: ".HelveticaNeueInterface-M3"; font-weight: normal; font-style: normal; font-size: 14.00pt | |
| "Bold Text" enabled | |
| Extra Small | |
| UIFontTextStyleHeadline | |
| font-family: ".HelveticaNeueInterface-Bold"; font-weight: bold; font-style: normal; font-size: 14.00pt | |
| UIFontTextStyleSubhead | |
| font-family: ".HelveticaNeueInterface-MediumP4"; font-weight: normal; font-style: normal; font-size: 12.00pt | |
| UIFontTextStyleBody | |
| font-family: ".HelveticaNeueInterface-MediumP4"; font-weight: normal; font-style: normal; font-size: 14.00pt | |
| UIFontTextStyleFootnote | |
| font-family: ".HelveticaNeueInterface-MediumP4"; font-weight: normal; font-style: normal; font-size: 12.00pt | |
| UIFontTextStyleCaption1 | |
| font-family: ".HelveticaNeueInterface-MediumP4"; font-weight: normal; font-style: normal; font-size: 11.00pt | |
| UIFontTextStyleCaption2 | |
| font-family: ".HelveticaNeueInterface-MediumP4"; font-weight: normal; font-style: normal; font-size: 11.00pt | |
| Small | |
| UIFontTextStyleHeadline | |
| font-family: ".HelveticaNeueInterface-Bold"; font-weight: bold; font-style: normal; font-size: 15.00pt | |
| UIFontTextStyleSubhead | |
| font-family: ".HelveticaNeueInterface-MediumP4"; font-weight: normal; font-style: normal; font-size: 13.00pt | |
| UIFontTextStyleBody | |
| font-family: ".HelveticaNeueInterface-MediumP4"; font-weight: normal; font-style: normal; font-size: 15.00pt | |
| UIFontTextStyleFootnote | |
| font-family: ".HelveticaNeueInterface-MediumP4"; font-weight: normal; font-style: normal; font-size: 12.00pt | |
| UIFontTextStyleCaption1 | |
| font-family: ".HelveticaNeueInterface-MediumP4"; font-weight: normal; font-style: normal; font-size: 11.00pt | |
| UIFontTextStyleCaption2 | |
| font-family: ".HelveticaNeueInterface-MediumP4"; font-weight: normal; font-style: normal; font-size: 11.00pt | |
| Medium | |
| UIFontTextStyleHeadline | |
| font-family: ".HelveticaNeueInterface-Bold"; font-weight: bold; font-style: normal; font-size: 16.00pt | |
| UIFontTextStyleSubhead | |
| font-family: ".HelveticaNeueInterface-MediumP4"; font-weight: normal; font-style: normal; font-size: 14.00pt | |
| UIFontTextStyleBody | |
| font-family: ".HelveticaNeueInterface-MediumP4"; font-weight: normal; font-style: normal; font-size: 16.00pt | |
| UIFontTextStyleFootnote | |
| font-family: ".HelveticaNeueInterface-MediumP4"; font-weight: normal; font-style: normal; font-size: 12.00pt | |
| UIFontTextStyleCaption1 | |
| font-family: ".HelveticaNeueInterface-MediumP4"; font-weight: normal; font-style: normal; font-size: 11.00pt | |
| UIFontTextStyleCaption2 | |
| font-family: ".HelveticaNeueInterface-MediumP4"; font-weight: normal; font-style: normal; font-size: 11.00pt | |
| Large | |
| UIFontTextStyleHeadline | |
| font-family: ".HelveticaNeueInterface-Bold"; font-weight: bold; font-style: normal; font-size: 17.00pt | |
| UIFontTextStyleSubhead | |
| font-family: ".HelveticaNeueInterface-MediumP4"; font-weight: normal; font-style: normal; font-size: 15.00pt | |
| UIFontTextStyleBody | |
| font-family: ".HelveticaNeueInterface-MediumP4"; font-weight: normal; font-style: normal; font-size: 17.00pt | |
| UIFontTextStyleFootnote | |
| font-family: ".HelveticaNeueInterface-MediumP4"; font-weight: normal; font-style: normal; font-size: 13.00pt | |
| UIFontTextStyleCaption1 | |
| font-family: ".HelveticaNeueInterface-MediumP4"; font-weight: normal; font-style: normal; font-size: 12.00pt | |
| UIFontTextStyleCaption2 | |
| font-family: ".HelveticaNeueInterface-MediumP4"; font-weight: normal; font-style: normal; font-size: 11.00pt | |
| Extra Large | |
| UIFontTextStyleHeadline | |
| font-family: ".HelveticaNeueInterface-Bold"; font-weight: bold; font-style: normal; font-size: 18.00pt | |
| UIFontTextStyleSubhead | |
| font-family: ".HelveticaNeueInterface-MediumP4"; font-weight: normal; font-style: normal; font-size: 16.00pt | |
| UIFontTextStyleBody | |
| font-family: ".HelveticaNeueInterface-MediumP4"; font-weight: normal; font-style: normal; font-size: 18.00pt | |
| UIFontTextStyleFootnote | |
| font-family: ".HelveticaNeueInterface-MediumP4"; font-weight: normal; font-style: normal; font-size: 14.00pt | |
| UIFontTextStyleCaption1 | |
| font-family: ".HelveticaNeueInterface-MediumP4"; font-weight: normal; font-style: normal; font-size: 13.00pt | |
| UIFontTextStyleCaption2 | |
| font-family: ".HelveticaNeueInterface-MediumP4"; font-weight: normal; font-style: normal; font-size: 12.00pt | |
| Extra Extra Large | |
| UIFontTextStyleHeadline | |
| font-family: ".HelveticaNeueInterface-Bold"; font-weight: bold; font-style: normal; font-size: 19.00pt | |
| UIFontTextStyleSubhead | |
| font-family: ".HelveticaNeueInterface-MediumP4"; font-weight: normal; font-style: normal; font-size: 17.00pt | |
| UIFontTextStyleBody | |
| font-family: ".HelveticaNeueInterface-MediumP4"; font-weight: normal; font-style: normal; font-size: 19.00pt | |
| UIFontTextStyleFootnote | |
| font-family: ".HelveticaNeueInterface-MediumP4"; font-weight: normal; font-style: normal; font-size: 15.00pt | |
| UIFontTextStyleCaption1 | |
| font-family: ".HelveticaNeueInterface-MediumP4"; font-weight: normal; font-style: normal; font-size: 14.00pt | |
| UIFontTextStyleCaption2 | |
| font-family: ".HelveticaNeueInterface-MediumP4"; font-weight: normal; font-style: normal; font-size: 13.00pt | |
| Extra Extra Extra Large | |
| UIFontTextStyleHeadline | |
| font-family: ".HelveticaNeueInterface-Bold"; font-weight: bold; font-style: normal; font-size: 20.00pt | |
| UIFontTextStyleSubhead | |
| font-family: ".HelveticaNeueInterface-MediumP4"; font-weight: normal; font-style: normal; font-size: 18.00pt | |
| UIFontTextStyleBody | |
| font-family: ".HelveticaNeueInterface-MediumP4"; font-weight: normal; font-style: normal; font-size: 20.00pt | |
| UIFontTextStyleFootnote | |
| font-family: ".HelveticaNeueInterface-MediumP4"; font-weight: normal; font-style: normal; font-size: 16.00pt | |
| UIFontTextStyleCaption1 | |
| font-family: ".HelveticaNeueInterface-MediumP4"; font-weight: normal; font-style: normal; font-size: 15.00pt | |
| UIFontTextStyleCaption2 | |
| font-family: ".HelveticaNeueInterface-MediumP4"; font-weight: normal; font-style: normal; font-size: 14.00pt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment