我在之前的应用程序中使用了自定义字体.
文件名是"ProximaNova-Regular.otf"并加载我刚使用的字体...
[UIFont fontWithName:@"ProximaNova-Regular" size:20];
Run Code Online (Sandbox Code Playgroud)
这非常有效.
现在在这个新的应用程序中我有三个字体文件...
Dude_Willie.otf
Impact
handsean.ttf
Run Code Online (Sandbox Code Playgroud)
但我不知道如何加载这些.
我试过了
[UIFont fontWithName:<the file name> size:20];
Run Code Online (Sandbox Code Playgroud)
但这只是回到使用Helvetica.
如何找到要使用的名称?
所以我试图使用这个字体http://fortawesome.github.com/Font-Awesome/.我已将字体添加为资源并将其放在plist文件中.这是我使用它的方式:
[homeFeedButton.titleLabel setFont:[UIFont fontWithName:@"fontawesome" size:8]];
NSString *str = [NSString stringWithFormat:@"%C", @"\f030"];
Run Code Online (Sandbox Code Playgroud)
但这不起作用.有谁知道如何在Xcode项目中使用这种字体?