Skip to content

Latest commit

 

History

History
29 lines (24 loc) · 630 Bytes

print-system-font-names.md

File metadata and controls

29 lines (24 loc) · 630 Bytes

Print system font names

It's a quick way to get system font names. The code is from http://codewithchris.com/common-mistakes-with-adding-custom-fonts-to-your-ios-app/

Swift:

 for family: String in UIFont.familyNames
 {
            print("\(family)")
            for names: String in UIFont.fontNames(forFamilyName: family)
            {
                print("== \(names)")
            }
  }

Objective C

for (NSString* family in [UIFont familyNames])
{
    NSLog(@"%@", family);

    for (NSString* name in [UIFont fontNamesForFamilyName: family])
    {
        NSLog(@"  %@", name);
    }
}