Reputation: 12373
I'm trying to use a custom font (Sassoon Infant) in Xcode. Despite looking at the numerous posts here on this issue, i haven't been able to resolve the problem.
These are the steps i have taken so far.
SassoonInfantCom-Regular.ttf
to Fonts Provided by ApplicationfontWithName:@"Sassoon Infant Com"
, the name in Font Book@"Sassoon"
The font name is not showing up in IB either under the dropdown font menu. The above seems to work for most people but i can't get it working. Anyone have any ideas?
Upvotes: 2
Views: 856
Reputation: 3588
Also make sure you are editing the correct plist file for the "Fonts provided by application property"! I spent two days trying everything to make some custom fonts work. Then I realised I was editing the APPTest-info.plist (which is in the resources folder of the Tests folder in XCODE) instead of editing the APP-info.plist file!
In my defence, both files are really close to each other in the files navigator in Xcode... ;-)
Upvotes: 1
Reputation: 90117
Make sure that the font is added to your target. Select the font and check the target membership in the left Xcode sidebar.
Make sure that you got the correct font name. Open the font in "Font Book" and see its name.
Upvotes: 0
Reputation: 12113
I just added it into the bundle and did this
myLabel.font = [UIFont fontWithName:@"MyCustomFont" size:19];
MyCustomFont being a .ttf file.
Hope this helps.
Upvotes: 0