`

ios 添加字体

    博客分类:
  • ios
 
阅读更多

<!--?xml version="1.0" encoding="UTF-8" standalone="no"?--> 1、确定你的项目工程的resouce下有你要用的字体文件(.ttf,.odf)。

2、然后在你的工程的Info.plist文件中新建一行(Add Row),添加key为:UIAppFonts,类型为Array添加Value为XXX.ttf(你字体的名字)。
key为Item 0,值为xxxx.ttf。是这样,可以添加多个,使用的时候写对应字体名字就行。
3、在你的项目里要用字体的时候  xx.font = [UIFont fontWithName:@"XXX" size:20.0],这样就可以了。


<key>UIAppFonts</key>
     <array>
          <string>Exocet.TTF</string>
          <string>ExocetLight.TTF</string>
     </array>
 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics