Question

please tell me how to add new font to iphone xcode3.2.

Was it helpful?

Solution

This functionality isn't built into UILabel/UIFont in iOS < 3.2. But there is a third-party solution you can use: FontLabel

In iOS 3.2+, there's the UIAppFonts plist key!

Just do this before using it: add your font file (such as myfont.ttf) to your project, then edit the Info.plist like so:

info.plist http://cl.ly/97da7a4f67b1b81a540f/content

OTHER TIPS

The above methods worked for me in xcode 3.2! Thanks!:

step 1: drag your font into your project (prob a good idea to not have spaces in the font name) step 2: add a row to your info.plist file like shown above to enter your font. step 3: in, viewDidLoad() or wherever you are setting your label, enter code:

 UIFont *myFont = [UIFont fontWithName:@"secondbreakfast" size:40];
 myLabel.font = myFont;

I did it with the following way:

  1. Add the font type to the Xcode : Under the XIB, go the font setting -> manage font

  2. Add the font to the label:

    UIFont *myFont = [UIFont fontWithName:@"myfont" size:12]; label.font = myFont;

Hope it help

But in xcode 5

  1. Go to xcode preferences -> Fonts and colors.
  2. Then click on T button in the textField of Font.

A list of all colors open then click on setting button in bottom left corner and go to manage fonts

Here select All fonts and then add your own ttf file by clicking on plus button and your Font will be added.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top