I've combed SO for similar problems, and most of them seem to tell me that I've probably forgotten to add the font into the copy resources build phase. I've also made sure that both fonts are part of the build target.
I've double, and triple checked that. Both fonts are in the copy resources phase, and both are listed in the plist.
In my app delegate I check which fonts I have available for their respective font families, and I'm getting unexpected results
NSLog(@"%@", [UIFont fontNamesForFamilyName:@"DS-Digital"]);
NSLog(@"%@", [UIFont fontNamesForFamilyName:@"Proxima Nova"]);
The first prints out "( "DS-Digital-Italic" )" which is what I wanted, the second prints out " ( "ProximaNova-Regular") ", also expected.
When I go to use either of the fonts as follows, it only appears in the simulator, but on any device it defaults back to system font.
[_estimateLabel setFont:[UIFont fontWithName:@"DS-Digital-Italic" size:50]];
or
[cell.mainLabel setFont:[UIFont fontWithName:@"ProximaNova-Regular" size:20]];
Is there anything I'm missing? I am using XCode 5 with an iPad mini and an iPhone 5C, both iOs 7.
Open the font in Fontbook (It ships with your mac). Make sure you call it by the post-script name, like here:
Its called by @"HelveticaNeueCE-Thin"
Also make sure that you checked the name of your font in "Add to targets:" when you added them to the project, if you didn't do this, they won't be copied in the app bundle sent over to your iDevice.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With