How to use custom font in iOS apps?

Possible duplicate:
Can I embed my own font in an iPhone app?

Hi, I would like to use the myanmar font in my native iOS apps.

However, I do not know how to use this font.

The font name is Zawgyi.ttf and Myanmar Font.

I already installed this font in my macbook and I did not find this font in the font property of the xcode project.

I'm just a beginner for iOS.

Please help me how to do this?

Thank you for reading.

+4
source share
2 answers

You just need to drag the ttf font file to your resources folder and make the following entry in the info.plist file -

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

The UIAppFonts key accepts an array, so you can pass multiple fonts in it.

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

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

Just make sure you include the real font name in the code above. The font file name and its "real font name" may be different, so just open the font in the FontBook application and there you will see the real font name.

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

+9
source

How about the next

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

Source: https://habr.com/ru/post/945138/


All Articles