Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Name of non-system font in iPhone

I want to add a non-system font to my iPhone/iPad app.

I have added the font file to the project and also added the font to the UIAppFonts property of the info.plist.

To load the font I'm using fontWithName of UIFont. But the name of the font does not seem to be the file name, with or without extension, nor the name that appears in Font Book.

UIFont* font = [UIFont fontWithName:@"What goes here?" size:10];

Where do I find out the name of the font?

like image 381
hpique Avatar asked Nov 10 '10 11:11

hpique


2 Answers

UIFont's +familyNames and then +fontNamesForFamilyName: should do the trick.

like image 119
Josh Bleecher Snyder Avatar answered Nov 20 '22 04:11

Josh Bleecher Snyder


If you open the ttf file in Font Book on your Mac, the title of the window is the name iOS uses too. (In my case, AvantGarde Bk BT)

enter image description here

like image 21
Souleiman Avatar answered Nov 20 '22 03:11

Souleiman