I've noticed that the font file PingFang.ttc is no longer in /System/Library/Fonts/LanguageSupport/
on iOS 18. And I use CoreText APIs get the new font file, which is int the FontServices.framework
and named PingFangUI.ttc
.
But it doesn't seem to be a regular TrueType font collection. It can't be parsed correctly by stb_truetype. I copied this file to my mac, and it can't be opened by Font.app either, which says it doesn't contain installable fonts. It also can’t pass font validation (Font.app → File → Verify File), saying “System validation failed”, I don't know what that means.
So I tried to read the binary of that file. I've noticed that the ‘CFF ‘ table is missing in the new font file, and there is a new table 'hvgl'. But I can't find any documentation for this table. Maybe this is a new format. And what confuses me is that the TTC header of the new font file has not changed, same as the old PingFang.ttc
file, with a ‘ttcf’ tag, and majorVersion is 2 minorVersion is 0.
Please tell me how to parse the new format, so maybe I can modify stb_truetype to get our app to work.
Thanks!