Skip to content

Instantly share code, notes, and snippets.

@danstepanov
Created March 7, 2016 23:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danstepanov/e389643d14c68cb3bf80 to your computer and use it in GitHub Desktop.
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
// 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