标签:blog io ar os 使用 sp for 文件 on
1、向工程内添加*.tff字体文件。
2、检查*.tff字体文件是否包含在Target -> Bundle Phases -> Copy Bound Resources 下的列表中没有就添加进来。
3、编辑工程的Info.plist在其中添加Fonts provided by application(Raw Keys:UIAppFonts)并在Item中添加*.tff。
4、获取字体名称
查找字体名通过代码找出非系统字体
NSArray *familyNames = [[NSArray alloc] initWithArray:[UIFont familyNames]];
NSArray *fontNames;
NSInteger indFamily, indFont;
for (indFamily=0; indFamily<[familyNames count]; ++indFamily)
{
NSLog(@"Family name: %@", [familyNames objectAtIndex:indFamily]);
fontNames = [[NSArray alloc] initWithArray:
[UIFont fontNamesForFamilyName:
[familyNames objectAtIndex:indFamily]]];
for (indFont=0; indFont<[fontNames count]; ++indFont)
{
NSLog(@" Font name: %@", [fontNames objectAtIndex:indFont]);
}
}
标签:blog io ar os 使用 sp for 文件 on
原文地址:http://www.cnblogs.com/ioslps/p/4111247.html