Xcode custom fonts not showing up in Storyboard
Asked Answered
A

16

51

I added my two fonts to my project folder:

enter image description here

I added them to info.plist:

enter image description here

I can not see them in my custom font list in the storyboard:

enter image description here

What have i done wrong?

Anemophilous answered 24/9, 2015 at 7:10 Comment(2)
change font color then again check in storyboardLoment
After restarting XCode upteen times and banging my head against the wall, I finally found this comment to change the font color which caused the font list to reload. Thank you @shahulhameedGabfest
K
95

I know this is a pretty old question, but I ran into the same issue. And the above tips didn't work for me. Apart from the standard checks (present in bundle, restarting XCode, the thing that fixed my issue was that my label text type was marked as "Plain" and hence some fonts were not showing in the dropdown in the Storyboard. As soon as I changed the text type to "Attributed", all the fonts appeared in the dropdown.

Hope this'll help someone stuck with the same issue.

Kelvinkelwen answered 9/9, 2016 at 4:24 Comment(3)
But the custom font used to appear even if the cell was plain. I don't understand when or why suddenly I need to convert to attributed text (which is more cpu costly I imagine?)Dispart
In my case, my custom font was selectable in other files before but for other files it wasn't. If you were able to initially select your custom font, I would recommend closing your Xcode and re-opening itGenni
Your answer combined with DarkDust's answer solved the issue, thank you!Femoral
M
28

This drop-down box shows the system-wide installed fonts. So you need to install your custom font on your system first so it's appearing in that drop-down box. You can do that by double-clicking it, the FontBook.app opens and asks you whether you want to install the font.

Menjivar answered 24/9, 2015 at 7:13 Comment(6)
I did but they are still not displaying?Anemophilous
Have you restarted Xcode after installing the font? Are you able to use it in other apps, e.g. TextEdit?Menjivar
Check if you added them to the application bundle. They should be visible in the resources tab.Larcenous
Solved it, had to add them to the supporting files folder in xcode.Anemophilous
@LordVermillion Can you tell me where are these 'supporting files folder' in xcode ?Lichenology
This answer combined with DS.'s answer above solved my issue. Thank you!Femoral
S
7

I Installed the font in the system as per DarkDust solution and i am able to see the font in attributed type.

Then i changed the type to plain and i able to see the Custom font in the font types drop down.

Selfmade answered 5/6, 2018 at 6:17 Comment(2)
Where everything else failed, THIS helped me.Keystroke
Had to first uninstall the font in Font Book, re-install the font, relaunch XCode. Only THEN did IB finally show all my custom fonts in the Font/Family dropdown.Suprarenal
A
7

In my case I just turn the text from plain to attributed then turn it back again to plain then it showed up., hope this help anyone.

Alexio answered 2/3, 2021 at 6:29 Comment(2)
This works every time.Manana
That worked. Seems like an Xcode bug.Deification
D
5

This was a huge headache for me but I simply fixed it by: I fixed the issue by restarting my Mac. Then restarting Xcode.

Dinky answered 13/1, 2020 at 7:21 Comment(1)
In a sense, this is the correct answer. Current Xcode "ALWAYS" needs a restart for this to work. The other answers - also very helpful - are "sometimes" also needed. Another complete shambles from Apple.Veliavelick
C
5

I ran into the same issue and fixed with below steps

  1. Closed storyboard
  2. Cleared derived data
  3. Cleaned the project and open the story board

If this is not working then restart the Xcode.

Thanks

Caputo answered 9/2, 2021 at 9:44 Comment(0)
E
4

Had the same problem but this SO answer by user Saranjith solved it while the other solutions in this thread didn't: Xcode 8 custom font doesn't show up in interface builder

Basically in Font Book select "Computer Fonts" and then hit the + button and re add the Fonts.

This is happened to me after moving to Xcode 11 in Catalina from Xcode 10 in Mojave.

Erine answered 17/10, 2019 at 16:5 Comment(0)
L
3

Well, silly mistake on my part, but I didn't realize my font was named something way different from the file name.

Double-clicking the actual font file opened it in the font book, and that showed the actual font name. It was in the dropdown all along.

Lautrec answered 19/1, 2020 at 17:50 Comment(0)
J
2

I solved my problem when i used font name. Do not use file name. I was used like this [UIFont fontWithName:@"appFont" size:17] but it is wrong.

  1. Upload your font file to https://fontdrop.info/ and use the name
  2. My font file name is appFont.ttf but when i uploaded i saw Roboto Regular.
  3. [UIFont fontWithName:@"Roboto Regular" size:17]
Judaica answered 4/5, 2019 at 6:6 Comment(0)
C
2

Sometime I go to another file and come back, then my custom fonts are arrived. I think this is an issue of Xcode and will be solved in following version.

Coronograph answered 17/4, 2020 at 9:1 Comment(2)
I honestly don't think this will be fixed in any version.Clothesbasket
Even I am getting the same issue so many times. Sometimes It comes, sometimes not.Lyndsaylyndsey
W
2

Custom fonts show up at the very top!

I think maybe Apple changed it, but it seems that custom fonts show up at the very top of the list. No wonder I couldn't find them alphabetically :)

Willable answered 17/10, 2023 at 21:8 Comment(1)
This! Obvious when you know it, saved the rest of my hair from being pulled out, thxOught
H
1

Restart the computer was the only way to restore custom fonts on Xcode 15.4.

Hollyanne answered 19/6, 2024 at 8:42 Comment(1)
I was have to roll back to Xcode 15.1 to be able to change label font.Criner
T
0

If Xcode showed your custom font before but stopped to do it at some moment, try to readd font files to your project. It solved the problem for me. Other answers weren't helpful.

Turbidimeter answered 22/5, 2019 at 11:4 Comment(1)
Heh... it helps me on Intel device, but on M1 I'm still not able to display custom fonts since Xcode 15.3.Itemize
K
0

For me it was case sensitive issue with the font file name. Not sure if it's always for this reason...

Kerley answered 25/1, 2022 at 22:57 Comment(0)
H
0

In my case my fonts were in woff2 formats. Although woff2 is supported in iOS, the fonts don't appear or get rendered in Storyboards.

Heilner answered 1/6, 2022 at 14:48 Comment(0)
G
0

What worked for me was to add a key named "Application fonts resource path" to the Info.plist file with an empty value.

Garratt answered 17/5, 2024 at 8:50 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.