ios添加第三方字体
1.将字体库文件拖入项目中。
2.修改Info.plist:添加Fonts provided by application属性, 设值为字体体文件名.
3.(可选:点选Project文件, 查看Build Phases中的Compile Sources,如果没有字体库文件, 点+号添加.)
4.遍历ios所有预装字体,在控制栏找到字的字体
NSArray *familyNames = [UIFont familyNames];
for( NSString *familyName in familyNames ){
printf( "Family: %s \n", [familyName UTF8String] );
NSArray *fontNames = [UIFont fontNamesForFamilyName:familyName];
for( NSString *fontName in fontNames ){
printf( "\tFont: %s \n", [fontName UTF8String] );
}
NSLog(@"-------------");
}
5.使用字体
1 _Title.font = [UIFont fontWithName:@"STHeitiTC-Light" size:20];