FontName from CTFontRef

1.2k views Asked by At

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

There are 1 answers

2
NSGod On BEST ANSWER

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.