tags:

views:

144

answers:

1

Hi there!

With Core Text it was possible to get the outline of a CGGlyph by CTFontCreatePathForGlyph(...). Now I'd like to port from Core Text to Cocoa's font engine, so the question is: Is there a way to get the outline for a NSGlyph?

+1  A: 

Yes, you can use NSBezierPath's -appendBezierPathWithGlyph:inFont:.

I'd like to add that you can use CoreText with Cocoa, too. So in that sense you don't have to port at all.

Yuji
Thanks! I want this for a c++ graphics framework. Previously I was using Core Text, but I thought, using Cocoa would be more modern ...
Polybos
Core Text was introduced in Leopard, so it isn't old. It's largely just the Cocoa text-drawing APIs ported to Core Foundation. Some classes, such as CTFont and CTFontDescriptor, are even TFB with their Cocoa counterparts.
Peter Hosey