Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use custom font in iOS Apps? [duplicate]

Possible Duplicate:
Can I embed a custom font in an iPhone application?

Hi I would like to use myanmar font in my native iOS Apps.

However i don't know how to use that font.

Font name is Zawgyi.ttf and It's myanmar font.

I already installed that font in my macbook and i didn't found that font in my xcode project's font property.

I'm just beginner for iOS.

Please guide me how to do that?

Thanks you for reading.

like image 925
Fire Fist Avatar asked Dec 28 '22 05:12

Fire Fist


1 Answers

You just need to drag the font’s ttf file in your resource folder and do this following entry in your info.plist file –

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

UIAppFonts key accept a array so you can pass multiple fonts in it.

Now wherever you want to use the font in your application you can call:

[UIFont fontWithName:@"Cloister Black" size:64.0]

Just 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.

See my blog post on same topic here - http://www.makebetterthings.com/iphone/how-to-use-custom-fonts-in-iphone/

like image 152
Saurabh Avatar answered Dec 29 '22 20:12

Saurabh