Last active
September 6, 2023 03:35
-
-
Save simonbromberg/24a48fb5e94b2bde82df1e5c97e733da to your computer and use it in GitHub Desktop.
List all fonts available on iOS device in 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
// List all fonts on iPhone | |
NSArray *familyNames = [[NSArray alloc] initWithArray:[UIFont familyNames]]; | |
for (NSString *family in familyNames) { | |
NSLog(@"Family name: %@", family); | |
fontNames = [UIFont fontNamesForFamilyName: family]; | |
for (NSString *font in fontNames) { | |
NSLog(@" Font name: %@", font); | |
} | |
} |
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
let familyNames = UIFont.familyNames | |
for family in familyNames { | |
print("Family name " + family) | |
let fontNames = UIFont.fontNames(forFamilyName: family) | |
for font in fontNames { | |
print(" Font name: " + font) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You are missing a type declaration for
fontNames
inListFonts.m