Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Must one add custom font file to info.plist in Xcode?

Tags:

ios

uifont

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?

like image 549
12 revs Avatar asked Nov 17 '15 18:11

12 revs


People also ask

How do I add fonts to info plist?

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, .

What is info plist in Xcode?

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.


1 Answers

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>
like image 67
Charles A. Avatar answered Sep 28 '22 15:09

Charles A.