如何在Objective-c中使用“私人使用区域”字体

时间:2017-11-20 17:40:58

标签: ios objective-c iphone fonts

我正在尝试在我的IOS应用程序中使用字体图标,我可以显示来自其他的图像

enter image description here

当我使用下面的代码时,图像正在显示

[Label setFont:[UIFont fontWithName:@"fontello" size:50]]; [Label setText:[NSString stringWithUTF8String:"\u2692"]];

enter image description here

但是当我尝试使用来自私人用户区的代码时,没有显示

     [Label setFont:[UIFont fontWithName:@"fontello" size:50]];
    [Label setText:[NSString stringWithUTF8String:"\uE756"]];

enter image description here

任何人都可以帮助我,提前致谢!

2 个答案:

答案 0 :(得分:1)

您必须通过在复制文件构建阶段添加自定义字体文件来将其复制到资源。

答案 1 :(得分:0)

在副本包资源中添加自定义字体引用 enter image description here