I'm trying to add a custom font to my iOS app and I have followed all the necessary steps(plist, copy build resources etc). The font is working in the Builder Interface but when I run it all that shows up is boxes with ? in them. Please help this has been an issue for almost a week now. !(https://i.stack.imgur.com/7xJFC.jpg)
Asked
Active
Viewed 73 times
0
-
edit code ??? and screenshot of how you set it in IB – Shehata Gamal May 02 '18 at 18:08
-
Can you share a screenshot of the setup, another pair of eyes could help. – Kwaku Eshun May 02 '18 at 18:10
-
It is in the Info.plist and what do you mean how I set it in the IB, in font I selected custom and then my font – Harrison Paxton May 02 '18 at 18:10
-
I added a screenshot – Harrison Paxton May 02 '18 at 18:17
-
Show how you have it added in Info.plist ... It should look like this (although, if it's the only font you are adding, you'll have only `Item 0`): https://imgur.com/a/JNMXokJ ... It's case-sensitive, so make sure it's spelled correctly and includes the extension. – DonMag May 02 '18 at 20:17
-
I have it in exactly like that. Are you able to run a build of it and see it in the simulator? that is where I find the issue – Harrison Paxton May 02 '18 at 22:50
-
@HarrisonPaxton - yep, shows properly for both Simulator and Device. Add this code (I'm assuming you're using Swift) to your `viewDidLoad` func, and make sure `LuckiestGuy-Regular` shows up in the debug console output: https://pastebin.com/gLmGMBcz – DonMag May 03 '18 at 12:32
-
@HarrisonPaxton - ah, I see in comments to an answer that you've done this. Are you setting the text of the label in code? Or in IB? Have you tried creating a new single-view project just to test this? Is it possible you have a faulty font file? – DonMag May 03 '18 at 15:21
2 Answers
0
From what you described you seemed to have followed the correct steps.
Maybe it's the font name that's causing the issue?
According to this tutorial: Add Custom Fonts To Your App
the font name may not be what you expect. It could be very different than any of the visible font names that you can see
He says add this code in viewDidLoad
to of any of your view controllers to find all the font names that your app is currently using. There is a possibility the font name you entered might be different from the font name the app has it listed as:
override func viewDidLoad() {
super.viewDidLoad()
for family: String in UIFont.familyNames {
print("\(family)")
for names: String in UIFont.fontNames(forFamilyName: family)
{
print("== \(names)")
}
}
}

Lance Samaria
- 17,576
- 18
- 108
- 256
-
Sheesh I don’t know what to say. That’s an odd issue. Wish I could help some more. – Lance Samaria May 02 '18 at 22:49
-
Yeah, the only issue I have is in the build simulator and on my phone, everywhere else the font is installed and working properly – Harrison Paxton May 02 '18 at 22:50
-
If it works on your phone you should be good to go. I thought the font wasn’t showing up at all. It’s probably a simulator issue. Did you trying running it on a different version of XCode to see what happens in that version’s simulator? You can always download older or newer XCode versions – Lance Samaria May 02 '18 at 22:58
-
It’s not working on my phone or the simulator and yes I’ve tried different versions of xcode – Harrison Paxton May 03 '18 at 14:31
-
maybe this: https://stackoverflow.com/questions/41299467/question-mark-in-place-of-font-icon-for-some-font-codes?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa – Lance Samaria May 03 '18 at 14:36