第一步把otf或tff文件加入项目
第二部把查看是否成功导入
第三部plist文件加入文体文件名字
然后直接的到系统所有字体就可以看到其中用你加入的字体了
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]);
}
}
找出你加入字体的Family name所对应的Font name直接使用即可
UITextView.font = [UIFont fontWithName:@"huaduo" size:20];