美文网首页iOS技术栈
CoreText note: Client requested

CoreText note: Client requested

作者: 汗青fullstack | 来源:发表于2020-09-28 18:35 被阅读0次
控制台打印报错:
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/

相关文章

网友评论

    本文标题:CoreText note: Client requested

    本文链接:https://www.haomeiwen.com/subject/eohjuktx.html