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.
I use the following steps:
Add the font file (xxx.ttf) into your project.
Add “Fonts provided by application” in info.plist. Add the font file name(xxx.ttf) you needed into that array.
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.