Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can not include .ttf font into project

I am trying to include the font "Hipchick" into my project but it does not work. I have tested a few methods and ended up with this one: iOS tips: Custom Fonts to try to solve this but it still doesn't work.

Here is 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 in the bundle.

enter image description here

Here is the info about the font.

- (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 have tried "Hipchick", "hipchick" and "hitch__" but it still display the wrong font.

I would really appreciate any help possible.

like image 874
PeterK Avatar asked Mar 16 '13 09:03

PeterK


1 Answers

This is Step for, How to add custom font in Application.

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

enter image description here

For more info read This and This site.

FOR MOREINFORMATION :

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

like image 79
iPatel Avatar answered Nov 14 '22 01:11

iPatel