标签:
代码:
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
NSLog(@"--系统的所有字体--%@",[self getAllSystemFonts]);
NSLog(@"--系统当前字体--%@",[self getCurrentFont]);
}
#pragma -mark -functions
//获得系统的所有字体
- (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;
}
标签:
原文地址:http://www.cnblogs.com/yang-guang-girl/p/4607319.html