Skip to content

Instantly share code, notes, and snippets.

@orklann
Created November 19, 2020 06:49
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 orklann/abe0725c0c43aab790491b4464d0616c to your computer and use it in GitHub Desktop.
Save orklann/abe0725c0c43aab790491b4464d0616c to your computer and use it in GitHub Desktop.
Get all font families and its family members
NSFontManager *fm = [NSFontManager sharedFontManager];
NSArray *fontFamilies = [fm availableFontFamilies];
int i;
for (i = 0; i < [fontFamilies count]; i++){
NSArray *familyMembers;
familyMembers = [fm availableMembersOfFontFamily:
[fontFamilies objectAtIndex: i]];
int j = 0;
for (j = 0; j < [familyMembers count]; j++) {
NSLog(@"%@", [familyMembers objectAtIndex: j]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment