Re: Font Color In CTLineDraw?
Re: Font Color In CTLineDraw?
- Subject: Re: Font Color In CTLineDraw?
- From: Mike Rossetti <email@hidden>
- Date: Wed, 03 Sep 2008 09:17:59 -0600
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
On Sep 2, 2008, at 9:55 PM, David Duncan wrote:
On Sep 2, 2008, at 7:43 PM, Mike Rossetti wrote:
[attrString addAttribute:NSForegroundColorAttributeName
value:[NSColor lightGrayColor] // No effect.
range:NSMakeRange(0, [attrString length])];
Rendering a font with an NSColor attribute requires a current
NSGraphicsContext. If you don't have one, then it will take the
color form the CGContextRef instead.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden