Search code examples
iosobjective-cfontsuifontcustom-font

My custom font is not displaying


I'm trying to use a custom font in my iPhone app.

I created a key for it in my info.plist as follows:

<key>UIAppFonts</key>
<array>
        <string>CloisterBlack.ttf</string>
</array>

and I'm accessing the font like this:

[UIFont fontWithName:@"CloisterBlack" size:64.0]

but the font is not displaying. What could be the reason?


Solution

  • Make sure you give the real font name in above code. The font file name and its “real font name” can be different, so just open the font in FontBook app and there you can see the real name of the font.