2
votes

I have a font called "Sansumi-Ultralight". This is what I've done so far based on some tutorials:

1.Dragged the font (.ttf file) into my app

2.Add "UIAppFonts" in info plist. Add the name Sansumi-Ultralight in the field.

3.Use it by doing this : UILabel.font = [UIFont fontWithName:@"Sansumi-Ultralight" size:14];

It doesn't work. I tried to do prove-of-principle by replacing the font name with helvetica-ultralight and it also doesn't work. (Which is a second problem. I can't seem to use the other versions (italics,ultralight ..etc) built-in fonts, such as helvetica)

I wonder what I did wrong. Can someone help me?

Thanks.

2

2 Answers

5
votes

I think you forgot to include your font file in TestApp target membership

You see this http://tinypic.com/view.php?pic=b7h11i&s=5

4
votes

I use the following steps:

  1. Add the font file (xxx.ttf) into your project.

  2. Add "Fonts provided by application" in info.plist. Add the font file name(xxx.ttf) you needed into that array.

  3. Use it as [UIFont fontWithName:fontName size:size]; This fontName is not the filename (eg. xxx.ttf, not xxx for this case), you should open your ttf file and see the name of it.