NSArray *familyNames = [UIFont familyNames]; for( NSString *familyName in familyNames ){ printf( "Family: %s ", [familyName UTF8String] ); NSArray *fontNames = [UIFont fontNamesForFamilyName:familyName]; for( NSString *fontName in fontNames ){ printf( " Font: %s ", [fontName UTF8String] ); } }
添加自定义字体:
1.导入xxx.tff文件到项目文件夹
2.在plist添加UIAppFonts项,在该项的子项添加xxx.tff
3.build phases->copy bundle resources里添加xxx.tff