美文网首页
oreText note: Client requested n

oreText note: Client requested n

作者: 90后的晨仔 | 来源:发表于2021-12-16 09:54 被阅读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:].**

  • 解决方法:

在使用这个类似的方法时CTFontRef textFont = CTFontCreateWithName(( CFStringRef)([font fontName]), [font pointSize], NULL);[font fontName]进行如下处理就好了。

   NSString *fontName =  [font fontName];
if ([fontName isEqualToString:@".SFUI-Regular"]) {
        fontName = @"TimesNewRomanPSMT";
    }

相关文章

网友评论

      本文标题:oreText note: Client requested n

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