45

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?

Jaymin Raval
  • 205
  • 2
  • 19
Lord Vermillion
  • 5,264
  • 20
  • 69
  • 109
  • 3
    change font color then again check in storyboard – shahul hameed Sep 07 '19 at 06:27
  • 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 @shahulhameed – jdavidbakr Jul 02 '20 at 20:00

13 Answers13

88

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.

DS.
  • 2,846
  • 4
  • 30
  • 35
  • 2
    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?) – lucius degeer Mar 29 '19 at 20:57
  • 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 it – btrballin Mar 25 '20 at 01:50
  • 1
    Your answer combined with DarkDust's answer solved the issue, thank you! – Patrick Ridd May 11 '20 at 17:29
27

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.

DarkDust
  • 90,870
  • 19
  • 190
  • 224
6

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.

R. Mohan
  • 2,182
  • 17
  • 30
6

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

Jordan Kinsley
  • 111
  • 1
  • 2
  • 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. – Fattie Apr 19 '20 at 14:59
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.

Sean Dev
  • 1,239
  • 1
  • 17
  • 31
4

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.

Dylan
  • 1,121
  • 1
  • 13
  • 28
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.

Ryan H
  • 1,656
  • 14
  • 15
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]
ethemsulan
  • 2,241
  • 27
  • 19
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.

Luat Vu Dinh
  • 460
  • 6
  • 10
1

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

kalpa
  • 884
  • 1
  • 15
  • 22
0

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

Sherwin Zadeh
  • 1,339
  • 15
  • 17
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.

Mohamed Salah
  • 868
  • 1
  • 15
  • 34
-1

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.

Serega
  • 630
  • 1
  • 4
  • 12