FontName from CTFontRef

柔情痞子 提交于 2020-01-04 08:23:24

问题


I've a CTFontRef variable.

CTFontRef aFontRef;

Getting Size of Font was easy :

CGFloat aFontSize = CTFontGetSize(aFontRef);

Please help me in retrieving the FontName. I'm expecting the FontName to be something like MarkerFelt-Wide.

But, when I use methods like

CTFontCopyFullName(aFontRef)

I get Marker Felt Wide

Cheers Roshit


回答1:


Looks like you want the PostScript name, which you can obtain through CTFontCopyPostScriptName().

The PostScript name is an internal name, and is generally the preferred way to refer to a font by name.



来源:https://stackoverflow.com/questions/7463551/fontname-from-ctfontref

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!