Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 448
user754229 Avatar asked Jun 06 '11 17:06

user754229


People also ask

Why is my installed font not working?

Easiest fix: Download and reinstall the correct version of the file, making sure the font is compatible with your operating system. Locate the font files on your system and remove any duplicates. If that doesn't work, use the font in a different app to see if the font works at all.

Why is my installed font not showing up Mac?

Restart the computer. Apple OS X will rebuild its font cache, and Word will rebuild its font cache from that. For best performance in Word, try to run with all your fonts enabled all the time. Each time that Word starts, it compares its font cache with the system font cache.


1 Answers

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.

like image 65
Saurabh Avatar answered Sep 23 '22 00:09

Saurabh