I would like to have an app include a custom font for rendering text, load it, and then use it with standard UIKit elements like UILabel. Is this possible?
I would like to have an app include a custom font for rendering text,
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
iOS 3.2 and later support this. Straight from the What’s New in iPhone OS 3.2 doc:
Once the fonts have been set in the
Info.plist, you can use your custom fonts as any other font in IB or programatically.There is an ongoing thread on Apple Developer Forums:
https://devforums.apple.com/thread/37824 (login required)
And here’s an excellent and simple 3 steps tutorial on how to achieve this (broken link removed)
Info.plistfile calledUIAppFonts.UIAppFontsarrayInfo.plist[UIFont fontWithName:@"CustomFontName" size:12]to get the custom font to use with your UILabels and UITextViews, etc…Also: Make sure the fonts are in your Copy Bundle Resources.