I'm trying to load a font into an application. I think I'm doing it well. But it doesn't work on iOS < 5.0.
I'm included the font files as resources (using otf files), add them to UIAppFonts array and testing the fonts on buttons. Like this:
In Info.plist:
<key>UIAppFonts</key>
<array>
<string>FrutigerNextPro-Medium.otf</string>
<string>FrutigerNextPro-MediumIta.otf</string>
<string>FrutigerNextPro-Light.otf</string>
<string>FrutigerNextPro-LightIta.otf</string>
</array>
Them in the buttons like this:
btt_01.titleLabel.font = [UIFont fontWithName:@"FrutigerNextPro-Medium" size:20];
btt_02.titleLabel.font = [UIFont fontWithName:@"FrutigerNextPro-MediumIta" size:20];
btt_03.titleLabel.font = [UIFont fontWithName:@"FrutigerNextPro-Light" size:20];
btt_04.titleLabel.font = [UIFont fontWithName:@"FrutigerNextPro-LightIta" size:20];
The problem is that FrutigerNextPro-Medium and FrutigerNextPro-MediumIta are only loaded in devices and simulator using iOS >= 5.0. In devices and simulator with iOS < 5.0 it doesn't loads the font, I think it loads FrutigerNextPro-Light
and When I Log like this:
for (NSString *family in [UIFont familyNames]) {
NSLog(@"%@", [UIFont fontNamesForFamilyName:family]);
}
I get the font available in any platform:
(
"FrutigerNextPro-MediumIta",
"FrutigerNextPro-LightIta",
"FrutigerNextPro-Medium",
"FrutigerNextPro-Light"
)
I get the font available in any platform.
Can someone help me trying to understand what's going wrong.
Thanks