4

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.

1
  • 5
    Seriously, just Google "iOS custom font". Commented Feb 19, 2012 at 17:14

2 Answers 2

10

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/

Sign up to request clarification or add additional context in comments.

Comments

0

What about the following

UIFont *font = [UIFont fontWithName:@"Zawgyi" size:20]; [label setFont:font]; 

2 Comments

I already tried that one. showing only square. How to fix it?
This won't work for iOS app. He has to distribute 'his' font with the app. See Evan Mulawski's comments.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.