how to add new font to Xcode 3.2?

10,355

Solution 1

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

Solution 2

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;
Share:
10,355
priyanka
Author by

priyanka

Having near 5 years of experience in IT industry. sound knowledge in iPhone, iPad and iPod-touch Application development and java.

Updated on June 27, 2022

Comments

  • priyanka
    priyanka almost 2 years

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