- 报错
**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";
}
网友评论