打印iOS所支持的所有字体

王磊
2023-12-01
    NSMutableArray *fontNames = [[NSMutableArray alloc] init]; 
    NSArray *fontFamilyNames = [UIFont familyNames]; 
    for (NSString *familyName in fontFamilyNames) {
//        NSLog(@"Font Family Name = %@", familyName);
        NSArray *names = [UIFont fontNamesForFamilyName:familyName];
//        NSLog(@"Font Names = %@", fontNames); 
        [fontNames addObjectsFromArray:names];
    }
    NSLog(@"fontNames==%@",fontNames);
    [fontNames release]; 

 类似资料: