2

I've been working on the launch screen of an app and I ran across a problem. The custom font that I was using (grand hotel) shows up in the storyboard but is replaced by a default font in the simulator. It should be like this, but instead this happens. I've tried everything online: added it to the plist, set the target, put it in Copy Bundle Resources. I've looked everywhere but I can't seem to find a solution that solves my problem. Is there any way for me to fix this issue? Could it be because it is a launch screen?

huvarda
  • 75
  • 1
  • 1
  • 8

3 Answers3

1

Follow the below steps.

(1) Remove your custom fonts.

(2) Re-add your font like, Right click on your project --> add files --> select your custom font. (Make sure option copy items if needed is checked).

(3) Clean(⌘+shift+K) + Build(⌘+shift+B) your project.

To check if the custom fonts are availabel on runtime add this code:

print(UIFont.fontNames(forFamilyName: "Your_Custom_font_name")) // if it returns empty array it means fonts are not available on runtime and it is not added correctly.
Maddy
  • 1,660
  • 11
  • 24
0

Please check this... may any step you miss http://codewithchris.com/common-mistakes-with-adding-custom-fonts-to-your-ios-app/

0

Did you somewhere set the font programmatically by name? I figured out, that the name of a certain font is not necessarily the name, which is shown in Xcode. You can check out the real font names in Xcode by putting the following somewhere in your code:

for family: String in UIFont.familyNames {
    print("\(family)")
    for names: String in UIFont.fontNames(forFamilyName: family)
    {
        print("== \(names)")
    }
}
Lausbert
  • 1,471
  • 2
  • 17
  • 23
  • he said it "shows up in the storyboard" but not in simulator . – Maddy Jun 10 '17 at 11:01
  • what doesn't mean, that he isn't somewhere setting/overwriting the font programmatically by a "name", that is shown in storyboard, but slightly differs from the real name. – Lausbert Jun 10 '17 at 11:12