Search code examples
objective-cios4fonts

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.


Solution

  • 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.