1

I have download a ttf file for a custom font I want to use in my app.

I've added it to my supporting files, amended my .plst file so that there's a new entry called "fonts provided by application" and then set the value to the filename of my font file (copied and pasted so no typos).

I've also checked it's included in my Build phases, Copy bundle resources.

When i now select a label and then go to change the font, my custom font is not there.

Am i missing a step?

Thanks

user1923975
  • 1,389
  • 4
  • 13
  • 29

2 Answers2

5

First you have to install those particular fonts now those fonts are like family fonts with array so you can code like this

NSArray *arrFont = [UIFont fontNamesForFamilyName:@"Your font name"];

[lbl1 setFont:[UIFont fontWithName:[arrFont objectAtIndex:0] size:16]];
[lbl2 setFont:[UIFont fontWithName:[arrFont objectAtIndex:1] size:16]];
Bhavesh Lathigara
  • 1,355
  • 1
  • 15
  • 25
2

Try This. May be it help.

  1. Add the font files to your resource files
  2. Edit your Info.plist: Add a new entry with the key Fonts provided by application.
  3. if there is more than one file , For each of your files, add the file name to this array

In your application you can the use [UIFont fontWithName:@"YourFontName" size:14.f].

Wolverine
  • 4,264
  • 1
  • 27
  • 49