Custom font in XCode 4.3.2

fonts, ios, ipad, iphone, xcode

Solution

In the array the full filenames must be provided, so instead of Item 0 | String | GothaBoo, Item 1 | String | GothaBooIta you will have to turn this into Item 0 | String | GothaBoo.ttf, Item 1 | String | GothaBooIta.ttf

Secondly the filename or the fontname might be different than the name that iOS likes to see in `fontWithName:`. Use Fontbook on your Mac to get the right name, if it still does not work after you have changed the filenames in the .plist.

Problem

I know this subject has been run into the ground, however I have tried every solution I've found on StackOverflow to fix this issue, and its just not working for some reason. I am creating a `UILabel` programmatically, then using this font. The `UILabel` is rendering but not in the font I want it to (looks like its defaulting to something) First I imported two .ttf fonts into the xcode project under a folder called "Resources". The two fonts are Gotham Book and Gotham Book Italic (GothaBoo.ttf, GothaBooIta.ttf) Then, I added a line to the [my app]-Info.plist file called "UIAppFont", added two rows to the array, Item 0 | String | GothaBoo, Item 1 | String | GothaBooIta. I checked the Target Build Phases, under Copy Bundle Resources, and made sure the two fonts were in there. Then, I simply added this code to the viewDidLoad routine: ``` UILabel *myLabel1 = [[UILabel alloc] initWithFrame:CGRectMake(50, 100, 200, 100)]; myLabel1.text = @"Hello"; myLabel1.backgroundColor = [UIColor clearColor]; myLabel1.font = [UIFont fontWithName: @"GothaBoo" size: 48.0]; myLabel1.textColor = [UIColor blackColor]; [self.view addSubview:myLabel1]; ``` No dice. What on earth am I doing wrong? The project is in Xcode 4.3.2, for the iPad, running 5+ of iOS

Original source