familyName为系统字体样式集合
在UIFont中同时定义了属性和类方法,所以两种方法都可以获取到
#if UIKIT_DEFINE_AS_PROPERTIES
@property(class, nonatomic, readonly) NSArray<NSString *> *familyNames;
#else
+ (NSArray<NSString *> *)familyNames;
#endif
//每种系统字体样式中,又可以细分为几种
for(NSString *fontfamilyname in [UIFont familyNames])
{
NSLog(@"family:'%@'",fontfamilyname);
for(NSString *fontName in
[UIFont fontNamesForFamilyName:fontfamilyname])
{
NSLog(@"\tfont:'%@'",fontName);
}
NSLog(@"-------------%d",i++);
}