0

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.

aaa
  • 1,649
  • 1
  • 16
  • 22

1 Answers1

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
  • 5
    That 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
  • I see, that's interesting – oyvindhauge Jun 27 '15 at 23:16
  • @matt Do we have any quickaround for this to get it worked? – Praveenkumar Oct 14 '19 at 14:45