I have shape objects that contain text. I also have a routine to convert whatever text in in that shape to outline text. Originally, this was based on code in the Speedometer sample code. Unfortunately, the routines used in this process are now deprecated and I have been trying to update it, and it is not working so well.
The main process uses a subclass of NSLayout manager and used to implement:
- (void)showPackedGlyphs:(char *)glyphs length:(unsigned)glyphLen
glyphRange:(NSRange)glyphRange atPoint:(NSPoint)point font:(NSFont *)font
color:(NSColor *)color printingAdjustment:(NSSize)printingAdjustment
Now, I'm using:
- (void)showCGGlyphs:(const CGGlyph *)glyphs positions:(const NSPoint *)positions count:(NSUInteger)glyphCount font:(NSFont *)font matrix:(NSAffineTransform *)textMatrix attributes:(NSDictionary<NSString *, id> *)attributes inContext:(NSGraphicsContext *)graphicsContext
So far, I'va managed to get it working for odd shapes and multi-line styled text. One problem -- In the accumulated Bezier, each line of outline text is in the right order and position, but upside down. Obviously, this is going to require a transform somewhere, but so far all my attempts at such have been failures.
Anyone had success with this?