iOS-打印字体

代码:

// 用一个数组将全部字体(含自定义)的familyName和fontNames清晰的打印出来
- (void)printFontNames {

    NSArray *array = [UIFont familyNames];

    NSMutableArray *fonts = [NSMutableArray new];

    for (NSString *familyName in array) {

        NSArray *fontNames = [UIFont fontNamesForFamilyName:familyName];

        if (fontNames) {

            NSDictionary *dic = @{@"familyName":familyName,@"fontNames":fontNames};   

            [fonts addObject:dic];

        }

    }

    NSLog(@"fonts:\n%@",fonts);

}

你可能感兴趣的:(iOS-打印字体)