Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode custom fonts not showing up in Storyboard

Tags:

xcode

ios

fonts

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?

like image 681
Lord Vermillion Avatar asked Sep 24 '15 07:09

Lord Vermillion


People also ask

How do I add custom fonts to storyboard Xcode?

In the storyboard , drag a UILabel to you interface,select the label , and navigate to the Attribute Inspector,click the right icon button of the Font select area.In the popup panel , choose Font to Custom, and choose the Family of you embeded font name.

Why is Main Storyboard not showing up in Xcode?

You have SwiftUI enabled in your project, which does not use storyboards anymore. Your layout is inside the ContentView. swift file. If you do want to work the old way, with storyboards, you should uncheck 'Use SwiftUI' in the project creation screen.


2 Answers

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.

like image 142
DS. Avatar answered Oct 08 '22 02:10

DS.


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.

like image 41
DarkDust Avatar answered Oct 08 '22 02:10

DarkDust