在更新我的应用程序时,我注意到在 IOS13 上的 Xcode 11.2 中运行应用程序时,我在日志中收到大量警告。
CoreText note: Client requested name ".SFUI-Regular", it will get TimesNewRomanPSMT rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[UIFont systemFontOfSize:].
我挖了一下,发现了 WWDC 的这句话:
As mentioned in numerous WWDC sessions, dot-prefixed font names are not to be directly used.
我自己几乎完全使用 IB 和 nibs 来设置文本字段等的字体,并且在我的代码中的任何地方都没有提到“SFUI-Regular”,所以我不确定如何找到这些警告的实际原因(我有日志中有 20-30 行这样的内容)。
有没有人对我如何找到警告的来源以及如何解决它有任何提示?
最佳答案
控制台还有一个输出,可以尝试添加符号断点
CoreText note: Set a breakpoint on CTFontLogSystemFontNameRequest to debug.
关于ios - 如何在 IOS13 中找到这个与字体相关的 coretext 警告的来源?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58706570/