0

I have done everything you are supposed to do to make a custom font show up in an Xcode project. However, the font comes out Helvetica every time and not Oswald as I hoped. Here you can see the name of the font is in fact, Oswald. I also tried different names - Oswald-Light, Oswald-Regular, Oswald-Bold...

Showing the name of the font is Oswald

Here you can see that the .ttf files are in fact in my project. They are also in the projects folder in the finder - I checked that.

Showing the files are in the project

I put the names of the files in the .plist under Fonts Provided by Application.

Writing the .ttf files into the plist

And finally I told the label to use Oswald font. Again, I tried @"Oswald-Light",@"Oswald-Bold"...

Assigning Label as font Oswald

JJJ
  • 32,902
  • 20
  • 89
  • 102
Rossi
  • 609
  • 6
  • 14
  • This thread might be of some help: http://stackoverflow.com/questions/360751/can-i-embed-a-custom-font-in-an-iphone-application – will May 18 '12 at 17:53
  • Thanks, I looked at that before - I really think I did all the steps right, though so just a bit bummed it doesn't show up. – Rossi May 18 '12 at 18:31
  • 3
    Are the ttf files in your app's bundle after you build the project? Make sure the ttf files are in the target's Copy Bundle Resources build phase. If they aren't, they won't get copied to the app bundle when you build the project. – Swift Dev Journal May 18 '12 at 19:21
  • Thank you so much! That was a very specific comment and it was exactly what I needed. I really appreciate your help! – Rossi May 18 '12 at 19:39

1 Answers1

0

Solution: Make sure the ttf files are in the target's Copy Bundle Resources build phase. If they aren't, they won't get copied to the app bundle when you build the project.

Solved by Mark Szymczyk - third comment (just to make it explicit in SO-style that the problem was solved)

arberg
  • 4,148
  • 4
  • 31
  • 39