PingFang.ttc font file is missing in iOS 18.0

I'm an iOS developer, and I've been testing our app in iOS 18.0 Beta. I noticed that there's a problem with the font rendering, and after troubleshooting, I've found out that it's caused by the removal of the PingFang.ttc font in 18.0. I would like to ask the reason for removing this font file and which font should be used to display Chinese in the future?

My test device is an iPhone 11 Pro and the system version is iOS 18.0 (22A5297). I have also tested Beta 1 and it has the same issue. In previous versions of the system, the PingFang font is located in this directory /System/Library/Fonts/LanguageSupport/PingFang.ttc. But in iOS 18.0, the font file in this directory has become Kohinoor.ttc, and I've tested that this font can't display Chinese either.

I traversed the following system font directories and could not find the PingFang.ttc font file.

/System/Library/Fonts/AppFonts
/System/Library/Fonts/Core
/System/Library/Fonts/CoreAddition
/System/Library/Fonts/CoreUI
/System/Library/Fonts/LanguageSupport
/System/Library/Fonts/UnicodeSupport
/System/Library/Fonts/Watch

Looking for answers, thanks for the help!

Answered by Frameworks Engineer in 793422022

PingFang.ttc is no longer in /System/Library/Fonts/Core. iOS 18 has a new Chinese UI font.

It is highly discouraged to look for fonts in locations in the file system. Font files can change locations, change names, or get deleted in new versions of the OS. Instead it is encouraged that developers requiring low-level information about Fonts to use CoreText APIs. These APIs can enumerate the fonts that are available in the OS and also provide you with the file URL where the file resides.

Please file a Feedback Assistant report referencing this thread and how it processes fonts.

PingFang.ttc is no longer in /System/Library/Fonts/Core. iOS 18 has a new Chinese UI font.

It is highly discouraged to look for fonts in locations in the file system. Font files can change locations, change names, or get deleted in new versions of the OS. Instead it is encouraged that developers requiring low-level information about Fonts to use CoreText APIs. These APIs can enumerate the fonts that are available in the OS and also provide you with the file URL where the file resides.

Please file a Feedback Assistant report referencing this thread and how it processes fonts.

Hi, can you please tell if you resolved the issue?

Me too, programmes are not supposed to access font resources in privateFrameworks. I'm using libass to parse *** subtitles and the fallback font is PingFangUI.ttc. But libass told me: "error opening font error"

PingFang has moved, but it hasn't been removed entirely.

Regardless of whether you should use it, I discovered in the simulator runtime that it is now located at

/Library/Developer/CoreSimulator/Volumes/iOS_22A3351/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.0.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/FontServices.framework/CorePrivate/PingFangUI.ttc

So I assume (I haven't checked) that it should be /System/Library/PrivateFrameworks/FontServices.framework/CorePrivate/PingFangUI.ttc on device.

We noticed that in several devices used in China, PingFang is not installed as default. Right now the solution is to install PingFang fonts manually. I wonder whether this issue would be fixed.

Accepted Answer

The more significant issue here is that on macOS 15/iOS 18, the shipped version of PingFang is no longer a standards-compliant TTC file, but instead uses a nonstandard "hvgl" table to store glyph data (FB15161959). This means that despite CoreText being used to look up a font for Chinese text, the resulting font file cannot be parsed by cross-platform libraries. This has also been reported to Freetype, but they're unable to make progress without documentation on the new format: https://gitlab.freedesktop.org/freetype/freetype/-/issues/1281

If you are running your device in Chinese or even if Chinese is in the list of user languages, your application will get access to a version of PingFang that is parsable by third party libraries. PingFang.ttc is downloaded automatically for those users.

The key thing to remember is NOT to hard code the location of PingFang or any other font in your code. Please use CoreText APIs to locate them.

If you are dependent on a library that is not doing the right thing, please file a Feedback Assistant report with details about the library.

As far as I'm aware, mpv and libass are doing the right thing (performing font lookup via CoreText), but still fail to render some Chinese text in many cases. For instance, attempting to render the character "菱" on a machine with the en-US locale will result in last-resort fallback (and tofu), as the PingFang.ttc MobileAsset isn't downloaded (and I haven't been able to find any documented way to trigger it to download). Not all rendering of Chinese text takes place on machines with a Chinese locale.

I filed FB15161959 on this subject in September, and haven't received any response.

Currently, my recommendation to work around this issue is for app developers to ship a copy of Noto Sans CJK (which is permissively licensed), though depending on the application's font management infrastructure, this might require "pseudo-installing" the font via CTFontManagerRegisterFontsForURL. CJK fonts are fairly large, so the added filesize may be prohibitive for some developers; hopefully the system-font situation will be resolved soon.

PingFang.ttc font file is missing in iOS 18.0
 
 
Q