Last active
August 29, 2015 14:25
-
-
Save frowing/4e6b237c81cd78e12445 to your computer and use it in GitHub Desktop.
List All Fonts on iOS
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
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