Can I get a BezierPath of a text fragment in TextKit2?

I have an application where I drive a laser cutter. I need to generate vectors. I currently use the "old" TextKit to generate text fragments full of glyphs and NSBezierPath's append(withCGGlyph glyph: CGGlyph, in font: NSFont) to get a BezierPath that I then convert to laser cutter vectors.

For example:

With TextKit2 it looks like it is a major goal to avoid the complexities of Glyphs, which is cool. However is there some API (new, or something old that I missed) that can get me from the text in the TextFragment to a BezierPath? I would hate to be unable to make the jump to TextKit2 (both because TextKit2 looks easier to deal with, and because I'm sure TextKit1 is going to go away...)

Replies

Cool app!

Unfortunately, there isn't a great alternative for this at the moment. Could you please file an enhancement request through Feedback Assistant?

Filed FB9149772

Thanks, I would send a few more "sample output" images, but the forum software seems to be unable to process them. Maybe there is some sort of size limit. The best I can do is a "good until a few days from now" link: https://share.icloud.com/photos/0FOZkOkSVPzDOpdTkrEKGLqtQ#San_Jose (it is prob. fine that the link won't last long, that image is just me showing off, it has no text, so isn't in dire need of TextKit2 vending a bezier path!)

  • Thank you, I have attached the additional sample images to the request.

Add a Comment