我有一个CTFontRef,如何获取字符串形式的字体名称?
发布于 2011-07-12 10:33:16
阅读此http://developer.apple.com/library/mac/#documentation/Carbon/Reference/CTFontRef/Reference/reference.html
例如,定义了一些方法。
Getting Font Names
CTFontCopyPostScriptName
CTFontCopyFamilyName
CTFontCopyFullName
CTFontCopyDisplayName
CTFontCopyName
CTFontCopyLocalizedName发布于 2011-07-12 13:27:04
您需要更具体地说明您所说的“字体名称”是什么意思。PostScript的名字?显示名称?姓什么?
在任何情况下,你都会这样做:
NSString *postScriptName =
[(NSString *)CTFontCopyPostScriptName(fontRef) autorelease];
NSLog(@"postScriptName == %@", postScriptName);CFStringRef和NSString是免费桥接的(请参阅Toll-Free Bridged Types)。
https://stackoverflow.com/questions/6658886
复制相似问题