Le 3 sept. 08 à 17:17, Mike Rossetti a écrit :

Thanks for clearing that up David.

Apparently one cannot open an NSGraphicsContext within a CGContext, but I will experiment more this evening.

I'm discovering that drawing attributed text via CTLineDraw has significant limitation, but for my purposes I believe I can live within those limitations.

It would be, ahem, illustrative if there was an example or two of drawing simple NSAttributedString-based unicode text using CG in a CALayer within an NSView.

Thanks again,
Mike


Create an NSGraphicsContext from you CGContext:

+ [NSGraphicsContext graphicsContextWithGraphicsPort:flipped:];

Set it as the current context

+ [NSGraphicsContext setCurrentContext:];

And now you should be able to draw string into your CGContext.



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to