Reputation: 6349
I have followed the steps discussed in this related question, but without success.
fontFile.ttf
to Xcode Project resources.fontFile.ttf
as a string in the UIAppFonts array in Info.plist.actualFontName
in the code.fontFile.ttf
to target.I have checked that I am using the actual font name as recognized by Font Book and Finder info (CMD + i
in each). I have also double-checked the spelling and case-sensitivity of the included file name.
The code rendering the label works with other embedded system fonts, but not with the custom TTF. What else could be missing?
Upvotes: 1
Views: 1102
Reputation: 6349
The problem was that I was adding the file to "Compile Sources" instead of "Copy Bundle Resources".
Thus, step 4 should read as follows:
4. Add file fontFile.ttf to bundle resources of target
To check that the file is in the right place, navigate to the Build Phases tab of the project, scroll down to "Copy Bundle Resources" and verify the file's presence. If not there, simply add it by clicking the corresponding "+" button.
NOTE: This whole situation can be avoided if you select the "Add to target" checkbox when first dragging the file into your project.
Upvotes: 2