I was following the instructions on this website but I didn’t manage to get the custom fonts working. After trying for a while I found out the problem.
Here’s the updated details of how to use custom fonts in iPhone. This is only available for SDK 4.0 and above.
- Add your custom font files into your project using XCode as resources.
- Add a key to your info.plist file called “Fonts provided by application” ( Used to be called UIAppFonts).
- It’s an array key.
- For each font you have, enter the full name of your font file (including the extension).
- Save info.plist.
- Now in your application you can simply call [UIFont fontWithName:@”CustomFontName” size:12] to get the custom font to use with your UILabels and UITextView.
- “CustomFontName” is not the font’s file name. It is the font name registered in the operating system. For example, if you try to use “Bauhaus Medium BT.ttf”, the “CustomFontName” should be “Bauhaus Md BT”, no extension “.ttf” is needed. You need to install the font in your system to find out what name it is. Some fonts have 2 names, you may need FontForge to find out and try which one works.
- So far I found out that both ttf and otf format work out of the box. I haven’t tested other font formats yet.
*Points 1-6 credit to http://blog.beefyapps.com/