0

I'm trying to add a custom font to my iPhone app.

The font's name is: Susa-Regular.otf

I downloaded the font, installed it, dragged it over to xCode. Then I went into info.plist and added a row called "Fonts provided by application" and typed in Susa-Regular.otf

 UILabel *myLabel = [[UILabel alloc]initWithFrame:frame]; [myLabel setFont:[UIFont fontWithName:@"Susa-Regular" size: 35]]; 

When I run the app, the font is still the same. I don't get any error messages either.

Any idea why it doesn't work?

3 Answers 3

2

More than likely the "font name" is not the same as the file name.

Open the font in Font Book and see how it represents the font name and use that instead with spaces removed.

You can also use [UIFont familyNames] and [UIFont fontNamesForFamilyName:] to discover what name iOS is using for it.

Sign up to request clarification or add additional context in comments.

2 Comments

Yeah, that's what I did. Figured out that iOS used the name without the dash.
If it's a correct answer an upvote or accepting my answer would be appreciated! :-)
1

I figured it out. I dropped the dash and it worked perfectly!

 [myLabel setFont:[UIFont fontWithName:@"SusaRegular" size: 35]]; 

Comments

0

I use the uifont-name-grabber posted at: http://forgecode.net/2010/08/uifont-name-grabber/

Just drop the fonts you want into the xcode project, add the file name to its plist, and run it on the device you are building for, it will email you a complete font list using the names that UIFont fontWithName: expects.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.