UILabel with custom font displays *wrong* custom font
- by winsmith
I'm using this method to embed custom fonts in my iPhone app.
The embedding works: When I run the following code, the fonts are listed. (Currently, I'm embedding all family members of Myriad Pro in OTF format)
for( NSString *familyName in [UIFont familyNames] ){
for( NSString *fntName in [UIFont fontNamesForFamilyName:familyName] ){
NSLog(@"%@", fntName);
}}
When I try to set the font of a label to MyriadPro or MyriadPro-Bold, this works just as expected. However, when I set the font to MyriadPro-BoldCond, the label is still set in MyriadPro-Bold instead of the condensed version. (The font names are correct, I checked.) My Code:
[recommendationLabel setFont:[UIFont fontWithName:@"MyriadPro-BoldCond" size:140]];
recommendationLabel.adjustsFontSizeToFitWidth = YES;
What's the deal?