Search code examples
iphonexcodefontsxcode5

Custom Fonts in Xcode 5


How would you add a custom font in Xcode 5 and how would you change every label in the project to that font? Because I've heard you can only do this programmatically?


Solution

  • Much better option is to add the new font to your system/OS fonts directory and then from there it can be added in the storyboard or used with NSAttributed strings.

    Steps:

    1. Download your font .ttf files
    2. Go to any label/textview in your storyboard and select in top right attributes inspector: "Text" Then select > "Attributed"
    3. Click the little T icon next to the font name to open up the fonts editor
    4. Go to the cog/wheel/setting icon and select "Manage Fonts"
    5. Click the second from right "+" button and navigate to your fonts .ttf file to add to system fonts collection
    6. Now use your font by changing the font name in the storyboard or code :)

    Hope that helps!