CoreText - 创建CTFont时的性能警告?

ary*_*axt 1 objective-c core-text ctfont ctfontref

创建CTFont时,我收到以下警告.

CoreText性能注释:客户端请求"ArialRoundedMTBold"使用名称的PostScript名称字体"Arial Rounded MT Bold".

// Creating Font
CTFontRef fontWithoutTrait = CTFontCreateWithName((__bridge CFStringRef)(name), size, NULL);

// Font names I use to create a font 
[UIFont familyNames];
Run Code Online (Sandbox Code Playgroud)

如果我删除从[UIFont familyNames]获取的任何字体名称中的所有空格,它是否是核心文本的预期字体名称是否安全?

ary*_*axt 5

在创建字体时结束将全名转换为postscript名称.

+ (NSString *)postscriptNameFromFullName:(NSString *)fullName
{
    UIFont *font = [UIFont fontWithName:fullName size:1];
    return (__bridge NSString *)(CTFontCopyPostScriptName((__bridge CTFontRef)(font)));
}
Run Code Online (Sandbox Code Playgroud)