oreText note: Client requested n

2021-12-16  本文已影响0人  90后的晨仔

**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";
    }
上一篇 下一篇

猜你喜欢

热点阅读