美文网首页
使用自定义字体

使用自定义字体

作者: 水田夏木 | 来源:发表于2017-02-22 21:45 被阅读23次

这个只能算转载的吧,网上的资料太多了,不过已经无法区分来源了。
1.将字体添加到项目中
2.打开Target—>Build Phases—>Copy Bundle Resources.
手动添加字体到这里
3.编辑Info.plist文件
添加行Fonts provided by application
将加入的字体名连同扩展名填在这里。(名字同字体文件名)
4.打印出所有的字体名,查找到所需的字体(一般和字体文件名不同)

NSArray *familys = [UIFont familyNames];
    
    for (int i = 0; i < [familys count]; i++)
    {
        NSString *family = [familys objectAtIndex:i];
        NSLog(@"=====Fontfamily:%@", family);

    }

5.使用字体

相关文章

网友评论

      本文标题:使用自定义字体

      本文链接:https://www.haomeiwen.com/subject/hqfvwttx.html