Skip to content

Instantly share code, notes, and snippets.

@jimrutherford
Created July 26, 2013 21:27
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 jimrutherford/6092371 to your computer and use it in GitHub Desktop.
Save jimrutherford/6092371 to your computer and use it in GitHub Desktop.
Enumerate and list all fonts family names that are installed on a specific iOS device. Helpful to determine what font string name to use in [UIFont fontWithName:size:]
for (NSString *familyName in [UIFont familyNames]) {
for (NSString *fontName in [UIFont fontNamesForFamilyName:familyName]) {
NSLog(@"%@", fontName);
}
}
@jimrutherford
Copy link
Author

for familyName in UIFont.familyNames() { for fontName in UIFont.fontNamesForFamilyName(familyName) { print("\(fontName)"); } }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment