Search code examples
iosobjective-cxcodefonts

Custom Font (.ttf) added to project not available within app


I'm trying to add a custom font to my app but it doesn't appear when the app is running:

  1. Added the files to the project

enter image description here

  1. Checked the font is within the Target Membership

enter image description here

  1. Added the fonts to the app plist under the "Fonts provided by application":

enter image description here

  1. Checked the fonts are within the Target/ Build Phases/ Copy Bundle Resources:

enter image description here

  1. Installed the fonts in the Font Book

After that, when I run the app:

for (NSString* family in [UIFont familyNames])
{
    NSLog(@"FONT FAMILY: %@", family);
    
    for (NSString* name in [UIFont fontNamesForFamilyName: family])
    {
        NSLog(@"FONT:  %@", name);
    }
}

All fonts except the JetBrains ones are available. What am I missing?


Solution

  • Found the answer.

    Changed the "Fonts provided by application" key in the .plist file with "UIAppFonts" and the font started to work