Just a question about adding a custom font in Xcode. After I add it to my project's resources as a ttf file, I can use it inside a label in my storyboard for example. But do I need to add it to the info.plist file too?
Add your fonts to the Info. plist file where you will want to add your fonts. Hover on the last line in the list and click on the plus sign to add a new line. Select the option “Fonts provided by application.” Now you will add all your fonts and make sure the string is EXACTLY THE SAME as the font file (. otf, .
Xcode supplies an information property list file when you create a project from a template, as described in Create a project. By default, Xcode names this file Info. plist and adds it to your project as a source file that you can edit. Xcode creates one information property list for each target in the project folder.
Yes, you must add custom fonts to your Info.plist. You do this with the UIAppFont
Info.plist key (which shows up as Fonts provided by application
in the plist editor).
Here is the relevant documentation.
And an example:
<key>UIAppFonts</key>
<array>
<string>SomeFont.otf</string>
<string>SomeOtherFont.otf</string>
</array>
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