please tell me how to add new font to iphone xcode3.2.
4 Answers
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:

- 21,988
- 13
- 81
- 109

- 115,675
- 35
- 233
- 266
-
-
1i use this approach but when i load font using below code UIFont *myF = [UIFont fontWithName:@"my font name" size:12]; myF is return null; – priyanka Jul 28 '10 at 09:31
-
I would think that the name is wrong or the file isn't getting included in the project. There's a good post about this here: http://www.perfectline.co.uk/blog/uiappfonts-custom-fonts-with-the-iphoneipad-3-2-sdk – bjtitus Jul 28 '10 at 13:31
-
Hello! For me it doesn't work it crashes with an EXC_BAD_ACCESS when i want to retrieve the fontfamilynames. I already posted a questions [here](http://stackoverflow.com/questions/8727710/adding-a-uifont-and-looking-for-the-fontfamily-crashes-with-exc-bad-access). Could you tell me, what i'm doing wrong? Thx – NicTesla Jan 04 '12 at 13:32
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;

- 21
- 1
I did it with the following way:
Add the font type to the Xcode : Under the XIB, go the font setting -> manage font
Add the font to the label:
UIFont *myFont = [UIFont fontWithName:@"myfont" size:12]; label.font = myFont;
Hope it help

- 51
- 1
- 2
But in xcode 5
- Go to
xcode preferences
->Fonts and colors
. - Then click on
T
button in thetextField
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.