Created
March 7, 2016 23:57
-
-
Save danstepanov/e389643d14c68cb3bf80 to your computer and use it in GitHub Desktop.
This snippet will log all available fonts for the current project to the console
This file contains 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
// ADDING FONTS TO PROJECT | |
// | |
// 1. Add font to project | |
// 2. Make sure in project file, the fonts are in "Copy Bundle Resources" under "Build Phases" | |
// 3. Add font file names to Info.plist "Fonts provided by Application" | |
// 4. Use code below to print the name used by UIFont; it might not be what you expect. | |
for (NSString *familyName in [UIFont familyNames]) { | |
NSLog(@"%@", familyName); | |
for (NSString *name in [UIFont fontNamesForFamilyName:familyName]) { | |
NSLog(@" %@", name); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment