Cannot include .ttf font in project

I am trying to include the "Hipchick" font in my project, but it does not work. I tested several methods and ended up with this: iOS tips: custom fonts to try and solve this problem, but it still doesn't work.

Here are some screens and code:

enter image description here

The font is added to the project: "hitch __. Ttf"

enter image description here

It is added to the .plist.

enter image description here

It is included.

enter image description here

Here is the font information.

- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. NSLog(@"hipch___: %@",[UIFont fontNamesForFamilyName:@"Hipchick"]); testLbl.font = [UIFont fontWithName:@"Hipchick" size:30]; testLbl.text = @"Frank Zappa"; } 

I tried "Hipchick", "hipchick" and "hitch__", but it still displays the wrong font.

I would really appreciate any help.

+7
source share
1 answer

This is the step to add a custom font to the application.

1 - add the .TTF font to your application
2 - Modify application-info.plist file .
3 - add the key "Fonts provided by the application" in a new line
4 - and add each .TTF file (font) to each line.

enter image description here

Read more ... This and This is the site.

FOR FURTHER INFORMATION:

But after adding the font to your application, you need to apply / write the real name of your font, so check the box How to get the font name from the otf or ttf file?

+14
source

All Articles