UIFont 三种格式:
UIFont *font =[UIFont systemFontOfSize:20]; //标准字体
UIFont *font =[UIFont italicSystemFontOfSize:20]; //斜体
UIFont *font =[UIFont boldSystemFontOfSize:20];//粗体
打印系统支持的所有字体
NSArray * familyNames = [UIFont familyNames];
for(NSString * familyName in familyNames)
{
NSLog(@"%@", familyName);
NSArray * fontNames = [UIFont fontNamesForFamilyName:familyName];
for(NSString * fontName in fontNames)
{
// NSLog(@"\t%@", fontName);
printf("%s\n",[fontName UTF8String]);
}
}
使用特殊字体
[UIFont fontWithName:@"Helvetica-BoldOblique" size:20]];
常见字体中文名称对照
冬青黑 Hiragino Sans