开发者

Adding custom fonts to my iphone application

I want to use a custom font in my iPhone app. After doing some research I found that you 开发者_运维知识库can add a custom font to your package. So I copied the font, which is digreadout2.ttf to my app folder and added a key in the .plist file. using the exact filename including the extension.

I then create the UIFont object and assign it to the font property of my UILabel. Now the problem is that when I run my app it gives me an error saying <Error>: FT_Open_Face failed: error 2.

If anyone has any suggestions of what I can try it will be very helpful.


Thanks for the response, I found the error. Basically what happened was that the file I used for my font had a white space in the file name. So when I tried to load it in the plist file it gave the error of file not found, once I removed the space out of the filename everything worked perfecty.


Error 2 in Free Type is FT_ERR_BADLABEL which I guess is the same as ENOENT - No such file or directory. Maybe you are using UIFont with the filename instead the font name. See Certain fonts not showing up?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜