I am implementing a custom font. Here is my code:
UIFont *font = [UIFont fontWithName: @"FlipboardFont" size: 41.0];
if (font) {
NSLog(@"Font non-zero and ready for use!");
label.font = font;
}
All variables are set up properly, and also, I have checked nearly every link on this site. Here also is a list of things I have done:
Added the font name + extension as a key value to the 0 item of “Fonts provided by application” array in plist
Deployment Target build setting doesn’t go back any farther than version 3.2.
font is included in build target (in the “Copy Bundle Resources” build phase)
raw value of the key for “Fonts provided by application” is UIAppFonts.
But still, it doesn’t work. Obviously, my log is never called. What is there to do?
UPDATED:
Ok, so I have tried kevboh’s suggestion. In FontBook, I found that the font is named differently to “Helvetica Neue”, and then there was a drop down list with different options, I wanted the condensed bold so I tried:
UIFont *font = [UIFont fontWithName: @"Helvetica Neue Condensed Bold" size: 41.0];
But still no luck 🙁
Open the font with FontBook and make sure you’re using the right name in
fontWithName:, see here: UIFont with custom font fails with Nil