标签:obj after nsarray sys family add etc nal loading
代码:
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
NSLog(@"--系统的所有字体--%@",[self getAllSystemFonts]);
NSLog(@"--系统当前字体--%@",[self getCurrentFont]);
}
//获得系统的所有字体
- (NSArray*)getAllSystemFonts;
{
NSMutableArray *array = [[NSMutableArray alloc] init] ;
NSArray* familys = [UIFont familyNames];
for (id obj in familys) {
NSArray* fonts = [UIFont fontNamesForFamilyName:obj];
for (id font in fonts)
{
[array addObject:font];
}
}
return array;
}
//获得系统的当前字体
- (UIFont*)getCurrentFont
{
//判断系统字体的size,返回使用的字体。
UIFont *font = [UIFont systemFontOfSize:[UIFont systemFontSize]];
return font;
}
标签:obj after nsarray sys family add etc nal loading
原文地址:http://www.cnblogs.com/yang-guang-girl/p/6866192.html