Re: Text rendered in NSImage is fuzzy
Re: Text rendered in NSImage is fuzzy
- Subject: Re: Text rendered in NSImage is fuzzy
- From: David Duncan <email@hidden>
- Date: Sun, 27 Jun 2010 14:30:19 -0700
On Jun 27, 2010, at 2:18 PM, Kyle Sluder wrote:
> Be aware that this means CATextLayer will suffer the same problem. It even does if you specify a background color for the layer. If you're using Core Animation and want subpixel antialiasing, you have to do it yourself.
Due to the way that Core Animation works, setting the background color of a layer is different from drawing into the layer (you can think of it like drawing twice, once for the background color and once for the actual layer content). As such, when the text is drawn, there is only 'clear color' for the text to draw over, and thus you get no subpixel smoothing.
You can get subpixel smoothing in CATextLayer by subclassing and overriding -drawInContext: to first draw an opaque color into the target context before calling -[super drawInContext:].
--
David Duncan
_______________________________________________
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