I created a label in LaunchScreen.storyboard and used a custom font. It looks all right in xcode but when I run the program on my device or simulators it won't display the custom font. I've already added the font file to the project and the font name to the "Fonts provided by application" array in info.plist. The font file is also added to "Copy Bundle Resources". I've tried all the solutions provided in some other similar questions but none of them worked so I'm not asking a repeated question.
Asked
Active
Viewed 744 times
0
-
What happens if you try setting the font in code? – oyvindhauge Jun 27 '15 at 22:27
-
Is your font set on that label for all size classes? – ndmeiri Jun 27 '15 at 22:29
-
Is that necessary to set it in code since everything's all set in xcode? – aaa Jun 27 '15 at 22:42
-
No, it is not necessary. I'd test it out though, for the sake of troubleshooting. – oyvindhauge Jun 27 '15 at 22:59
1 Answers
0
Place this piece of code in your AppDelegate (didFinishLaunchingWithOptions:) to check that the custom fonts are available in the project:
NSArray *fontFamilies = [UIFont familyNames];
for (int i = 0; i < [fontFamilies count]; i++)
{
NSString *fontFamily = [fontFamilies objectAtIndex:i];
NSArray *fontNames = [UIFont fontNamesForFamilyName:[fontFamilies objectAtIndex:i]];
NSLog (@"%@: %@", fontFamily, fontNames);
}

oyvindhauge
- 3,496
- 2
- 29
- 45
-
5That code (`didFinishLaunchingWithOptions:`) would run long after the launch screen has been and gone. That's the whole problem; he's trying to show this font _in the launch screen_. But by definition the font has not loaded yet; the app hasn't started running, so there's no font yet. – matt Jun 27 '15 at 23:14
-
-