来自CTFontRef的FontName [英] FontName from CTFontRef

查看:312
本文介绍了来自CTFontRef的FontName的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个CTFontRef变量.

I've a CTFontRef variable.

CTFontRef aFontRef;

获取字体大小很容易:

CGFloat aFontSize = CTFontGetSize(aFontRef);

请帮助我检索FontName. 我希望FontName类似于 MarkerFelt-Wide .

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

但是,当我使用

CTFontCopyFullName(aFontRef)

我得到标记毛毡宽

欢呼 罗什特(Roshit)

Cheers Roshit

推荐答案

看起来像您想要的PostScript名称,可以通过

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

PostScript名称是一个内部名称,通常是按名称引用字体的首选方式.

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

这篇关于来自CTFontRef的FontName的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆