iOS技术栈

CoreText note: Client requested

2020-09-28  本文已影响0人  汗青fullstack
控制台打印报错:
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:].
处理方式:

全局搜索 CTFontCreateWithName,fontName 由".SFUI-Regular"替换成"TimesNewRomanPSMT"

            NSString *fontName = self.titleLabel.font.fontName;
            if ([self.titleLabel.font.fontName isEqualToString:@".SFUI-Regular"]) {
                fontName = @"TimesNewRomanPSMT";
            }
            CTFontRef ctfontForTitle = CTFontCreateWithName((CFStringRef)fontName, self.titleLabel.font.pointSize, NULL);

参考:http://591xt.com/2020/09/09/Client-requested-name-SFUI-Regular/

上一篇 下一篇

猜你喜欢

热点阅读