Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom Fonts not showing on Xcode 11 (macOS Catalina)

I have a problem loading custom fonts in the drop down menu to select fonts in storyboard, I have poppins font and MarvinVisionsBig. I have already added them as target membership, bundle resources and added them to the plist and they are already installed in the system. I tried everything but nothing seems to be working.

The fonts are printed when using this to show them :

for family: String in UIFont.familyNames {
    print(family)
    for names: String in UIFont.fontNames(forFamilyName: family) {
        print("== \(names)")
    }
}

Console:

enter image description here

DropDown:

enter image description here

Fonts:

enter image description here

Bundle resources:

enter image description here

Plist:

enter image description here

like image 605
mohamed mernissi Avatar asked Oct 15 '19 13:10

mohamed mernissi


People also ask

How do I add custom fonts to Xcode?

To add a font file to your Xcode project, select File > Add Files to “Your Project Name” from the menu bar, or drag the file from Finder and drop it into your Xcode project. You can add True Type Font (. ttf) and Open Type Font (. otf) files.

How do I import fonts to IOS?

You can download fonts from the App Store app , then use them in documents you create on iPhone. After you download an app containing fonts from the App Store, open the app to install the fonts. To manage installed fonts, go to Settings > General, then tap Fonts.

How do I add fonts to react native Xcode?

You can fetch your fonts from Google Fonts. In your React Native project src directory, you should create an assets directory. Here you'll have a directory for each kind of asset (SVG, Fonts, etc). Therefore, create a fonts directory and paste the fonts that you downloaded.


1 Answers

This is a known issue in upgrading to Xcode 11.4, which is seemingly only affecting users who upgraded to Catalina instead of clean install.

In theory, having the fonts in your Info.plist and setting the Font entitlement should work but I could not get it to cooperate. My solution is not recommended as it could corrupt your Xcode but just as quick fix for anyone spending hours on this and don't want to roll back.

This is a no-code solution. What you need to do is compile for 13.4 from Xcode 11.3.1.

  1. Explore the Package Contents of Xcode 11.4 beta and copy the folder labeled '13.4' from Contents > Developer > Platforms > iPhoneOS > DeviceSupport.
  2. Paste it in the same directory location inside Xcode 11.3.1.
  3. Open your project/workspace in 11.3.1.
  4. CMD+Shift+K to clean and run it again. Fonts should now behave as expected.
  5. If the issue still persists delete the app from your device/simulator and try steps 3 and 4 again.
like image 133
Farhan Farooqui Avatar answered Oct 04 '22 03:10

Farhan Farooqui