Unable to set custom font for the UILabel in XCode

FrozenHeart picture FrozenHeart · Jul 21, 2014 · Viewed 7.5k times · Source

I am unable to set custom font for the UILabel in XCode.

This is what I've tried:

  • Download "JennaSue" font -- http://www.dafont.com/jenna-sue.font

  • Open "app-info.plist" under "Supporting Files" folder

  • Add new row in the list with key "Fonts provided by application"

  • In this array add "JennaSue.ttf"

  • Use it in the code like this:

self.someLabel.font = [UIFont fontWithName:@"JennaSue" size:14];

And nothing happens -- the default font is visible.

Why? What am I doing wrong? How can I fix it?

Answer

Gabriel.Massana picture Gabriel.Massana · Jul 21, 2014

Be sure your font is in Bundle Resources. For some reason Xcode it is not importing custom font properly most of the time:

enter image description here

enter image description here

enter image description here

I've got the font working:

enter image description here

Example code: here