在创建CTFont时,我会收到以下警告。
CoreText性能注意事项:客户端使用名称"Arial Rounded MT Bold"请求具有PostScript名称"ArialRoundedMTBold"的字体。
// Creating Font
CTFontRef fontWithoutTrait = CTFontCreateWithName((__bridge CFStringRef)(name), size, NULL);
// Font names I use to create a font
[UIFont familyNames];如果我从UIFont familyNames中删除任何字体名称中的所有空格,是否可以安全地假定它将是核心文本所期望的字体名称?
发布于 2013-08-19 13:07:25
最后,在创建字体时将全名转换为postscript名称。
+ (NSString *)postscriptNameFromFullName:(NSString *)fullName
{
UIFont *font = [UIFont fontWithName:fullName size:1];
return (__bridge NSString *)(CTFontCopyPostScriptName((__bridge CTFontRef)(font)));
}https://stackoverflow.com/questions/18291333
复制相似问题