Wrong fonts loaded from Storyboards in Xcode 15

We use Storyboards and custom fonts in our app. Once we started developing new features for iOS 17 and did the first build in Xcode 15, we've noticed that in quite a few places incorrect fonts are set to views. In some places it is incorrect weight, while in other it's completely different font.

Some observations:

  • Fonts may change the next time app is build. E.g., instead of SF Pro Display Semibold we got SF Pro Display Heavy, and then after few relaunches it switched to Nunito Bold 😵‍💫
  • We’ve ensured that correct font is set in Storyboard, and even tried to re-assign it. That didn’t help.
  • All custom fonts are properly added to a target and are registered in info.plist
  • All custom fonts are listed in UIFont.familyNames, so they are indeed registered with the system.
  • Wrong fonts are loaded on both development environment and in TestFlight builds
  • We’ve never experienced anything similar before Xcode 15

What we've tried:

  • Re-assigning fonts in Storyboard.
  • Creating new Storyboard in Xcode 15 and copying screens into it.

I wonder if anybody else having similar issues and maybe knows the workaround.

Thank you.

P.S. I've filed a Feedback to Apple: FB12903371

Answered by Serzhas in 768210022

The issue seems to be fixed in Xcode 15.1 Beta 1! Fonts in my test project are loaded correctly now. 🥳 Too bad, we are already setting all fonts from the code 😅

Here is how it looks in Xcode 15.0

This issue is mentioned in Xcode 15 Release Notes:

Note: Interface Builder documents using custom App fonts may load incorrect font at runtime. To workaround this, set font manually in code.

P.S. I have opened a Feedback Request for this issue after the Xcode 15 Beta 2, but it isn't fixed in release version. Therefore, I wouldn't hold my breath for it to be fixed any time soon. Probably, Interface Builder is now considered a legacy technology, so it doesn't get as much attention anymore... 🤷‍♂️

Sample project I've created for Apple to reproduce the issue: https://github.com/SergejLogis/FB12903371

Same issue here. It's OK to consider any feature as legacy technology, but leave it working as it was before, never broke it and look away as if nothing is happening...

We are facing the same issue. :(

Not sure if this is an Interface Builder is or something broader... I'm seeing this also when using plain SwiftUI. Suddenly I have some text becoming "smaller". For Text, I've been able to use .lineLimit to enforce it to not shrink. But with Toggle's, so far I don't have any luck.

Same issue. Project is too big for manual changing font in code. When we can expect fix for that issue?

This workaround effectively means you cannot use custom fonts in your launch screen storyboard unfortunately.

Accepted Answer

The issue seems to be fixed in Xcode 15.1 Beta 1! Fonts in my test project are loaded correctly now. 🥳 Too bad, we are already setting all fonts from the code 😅

Here is how it looks in Xcode 15.0

For those of you still having this problem, here is how I fixed this. You need to change the metadata for the font to match the filename of the font. The spelling must be exact in the plist file, font file, view font name. If your system cannot find the file you will need to click on the font name, go to the identity and type tab on the top right settings window. click on the full path and select your font file name. This will set your project to exactly where the font file is located. If this doesn't fix the error then clean your build folder or issues and recompile. I have been looking for a solution for this for a long time. If this works for you, please mark this reply as the accepted answer. Thanks, DB

fixed in Xcode 15.0.1

Fixed issue that caused Interface Builder documents using custom App fonts to load incorrect font at runtime. (116019276)

https://developer.apple.com/documentation/xcode-release-notes/xcode-15_0_1-release-notes

It seems like this has been fixed in iOS 15.0.1:

From here: xcode-15_0_1-release-notes

I have the same problem, The solution was this:

Open the font folder, reinstall all fonts and extract the archive directly. You can see in testflight that the archive fonts are properly installed.

It happened with me as well on Xcode 15.4. I tried all the solutions listed above plus other solutions mentioned on developer forum. At the end the best workaround to solve this issue was to add fonts using @IBInspectable

Check my answer here : https://stackoverflow.com/a/78921502/17610775

Wrong fonts loaded from Storyboards in Xcode 15
 
 
Q