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.
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))
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With