Reputation: 343
I am new to swift, and I'd like to add a custom font to my SpriteKit project, however, after looking around, I cannot find a solution.
Upvotes: 9
Views: 4320
Reputation: 6192
After that you go to your Info.plist and add the filename of the font (with extension) in "Fonts Provided By Application"
Now you can finally use the font als you would use every other font. If it doesn't work as it should you can find out the name Xcode gave the font with
Swift:
for name in UIFont.familyNames() {
println(name)
if let nameString = name as? String{
println(UIFont.fontNamesForFamilyName(nameString))
}
}
Swift 3:
for name in UIFont.familyNames {
print(name)
if let nameString = name as? String {
print(UIFont.fontNames(forFamilyName: nameString))
}
}
Upvotes: 13