Skip to content

Instantly share code, notes, and snippets.

@frowing
Last active August 29, 2015 14:25
Show Gist options
  • Save frowing/4e6b237c81cd78e12445 to your computer and use it in GitHub Desktop.
Save frowing/4e6b237c81cd78e12445 to your computer and use it in GitHub Desktop.
List All Fonts on iOS
NSArray *familyNames = [[NSArray alloc] initWithArray:[UIFont familyNames]];
NSArray *fontNames;
NSInteger familyIndex, fontIndex;
for (familyIndex = 0; familyIndex < [familyNames count]; ++ familyIndex) {
NSLog(@"Family name: %@", [familyNames objectAtIndex:familyIndex]);
fontNames = [[NSArray alloc] initWithArray:[UIFont fontNamesForFamilyName:
[familyNames objectAtIndex:familyIndex]]];
for (fontIndex = 0; fontIndex < [fontNames count]; ++ fontIndex) {
NSLog(@" Font name: %@", [fontNames objectAtIndex:fontIndex]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment