Skip to content

Instantly share code, notes, and snippets.

@bananita
Last active December 26, 2015 12:49
Show Gist options
  • Save bananita/7154505 to your computer and use it in GitHub Desktop.
Save bananita/7154505 to your computer and use it in GitHub Desktop.
Snippet that shows all available fonts.
NSArray *fontFamilyNames = [UIFont familyNames];
for (NSString *familyName in fontFamilyNames)
{
NSLog(@"Font Family Name: %@", familyName);
NSArray *names = [UIFont fontNamesForFamilyName:familyName];
NSLog(@"Font Names:\n %@", names);
}
//xamarin:
string[] fonts = UIFont.FamilyNames;
for (int i = 0; i < fonts.Length; i++) {
string[] names = UIFont.FontNamesForFamilyName(fonts[i]);
for (int j = 0; j < names.Length; j++)
Console.WriteLine (names [j]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment