In iOS4 (4.3 simulator) when I use the font Myriad Pro with the following font method for a cell:
cell.titleLabel.font = [UIFont fontWithName:@"Myriad Pro" size:14];
It looks like this:
In iOS5 (5.0 simulator) when I use the font Myriad Pro with the same font method it looks like this:
Has anyone experienced this behaviour as well (perhaps with other fonts?).
When using +fontWithName:size:
on iOS 5, the font name parameter needs to be the full name of the font file in your app bundle and not just the font family name.
The font rendering has changed in iOS 5. In iOS 4, only one face in a font file was usable no matter how many faces were in the font file and which face you requested.
iOS 5 allows all faces in an embedded font file to be usable.
In our case, we were requesting the regular font but getting the light font instead. In iOS 5 we get back the regular one, which screwed up some UILabel spacing.
It would help if I could see a bigger screenshot, but seems this is Myriad Pro Condensed, instead of Myriad Pro. The documentation for fontWithName:size:
says this about fontName
:
The fully specified name of the font. This name incorporates both the font family name and the specific style information for the font.
With passing "Myriad Pro" you are only specifying the family name. Maybe system is selecting randomly a wrong member of the font family for you. So try saying the full name of the typeface you want, which is "Myriad Pro Regular" in this case.