Skip to content

iOS and Custom Fonts

by dkberktas on January 26th, 2012


Recently, I was working on a game with Cocos2d and keep getting this weird iOS version problem. On iOS 5, all my labels were shown as expected but on iOS 4 labels somehow kept disappearing. First I thought this is because of the retina display and point/pixels stuff. However, it was because of the fonts I was using. HelveticaNeue-CondensedBold and HelveticaNeue-CondensedBlack are available on iOS 5, but not on iOS 4 (http://iosfonts.com/).

I googled to see how easy to add custom fonts and it turned out, it is super easy.

These are the links I found helpful:

  • Adding custom fonts by Dave Allanson (link)
  • Using Custom Fonts by M. Arsalan Anwar (link)
Steps to Add Custom Font:
1. Add font files to project
2. Open your Info.plist file
3. Create the key “UIAppFonts”  as Array (it will be shown as “Fonts provided by application”  if you are not on Ras Key/Value state, right click and you will see what I mean)
4. Add the fonts to the array
5. In your code, you can use these fonts as if you are using the regular ones (without the file extension).
Drawing Problems:
If you get the fonts from Adobe, we will get a drawing problem like mentioned here. You need to follow the steps here, change the font file’s ascender property. Don’t worry it is not that scary as it seems ;) Don’t forget to install Apple Font Tool Suite from here.
No comments yet

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS