14

It was explained in the WWDC 2014 videos that you can have Custom Fonts at designing time directly in Storyboard, but so far I only see the list of iOS fonts. Any help?

sapi
  • 9,944
  • 8
  • 41
  • 71
mengto
  • 689
  • 1
  • 7
  • 12

2 Answers2

39

All you have to do is to drag and drop the font files to your Xcode project, then you can find the font in the Custom font list. You don't even have to have them included in your Application Plist. That makes things simpler.

If you already had fonts added to Xcode 5.1 project, they will not show up in the custom fonts list upon upgrading to Xcode6. You can just remove references to the fonts then drop them in the project again and check the "copy to target". This will show custom fonts in the interface builder custom fonts dropdown on xCode6.

Cilan
  • 13,101
  • 3
  • 34
  • 51
mengto
  • 689
  • 1
  • 7
  • 12
  • 12
    hello, I see my font in the Xcode 6, but when I test app on my device font doesn't work. As I saw on another question, you need to add `Fonts provided by application` to plist to see effect on device – Dima Deplov Sep 01 '14 at 21:46
  • Any luck with attributed text? They don't show custom fonts, just the ones you have installed on your computer. – Fábio Oliveira Sep 10 '14 at 20:43
  • 7
    @flinth that looks like you didn't add the font to your target. – Andrew Robinson Sep 19 '14 at 20:43
  • 1
    I got attributed text to work! My problem was any font other than Regular, Italic, Bold, or Light weren't able to be created programmatically. In my case, a semibold font was showing up in the storyboard, but when I created it programmatically it crashed the app. What I had to do was make sure a .xib or .storyboard file was using the font I wanted. Otherwise, it looks like Xcode optimizes it out when loading the available fonts at runtime. My attributed text now works with any custom font this way. – lehn0058 Dec 02 '14 at 16:50
  • 1
    I still had to add the Fonts provided by application key to my plist, even after copying the font to the target's bundle resources. Xcode 7.2 – user3344977 Feb 01 '16 at 08:02
0

First use your custom font in storyboard then you can use it in code.