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?
Asked
Active
Viewed 954 times
2
-
Looks like your constraints arent working. – KingCoder11 Jun 10 '17 at 10:02
-
The constraints work for the grand hotel font because the letters are written close to each other. The letter spacing of the other font is bigger. – huvarda Jun 10 '17 at 10:05
-
did you drag and drop it in your project. – Maddy Jun 10 '17 at 10:34
-
Check this post may help https://stackoverflow.com/questions/40168344/xcode-8-custom-font-doesnt-show-up-in-interface-builder/40170579#40170579 – Joe Jun 10 '17 at 11:19
-
Are you setting this font in storyboard? – VIP-DEV Jun 10 '17 at 14:19
-
yes I am. Its not working. – huvarda Jun 10 '17 at 16:13
3 Answers
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/
-
I already checked it out and did everything but it still doesn't work. – huvarda Jun 10 '17 at 11:47
-
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
-
-
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