CATextLayer and subpixel anti-aliasing
CATextLayer and subpixel anti-aliasing
- Subject: CATextLayer and subpixel anti-aliasing
- From: Milen Dzhumerov <email@hidden>
- Date: Fri, 28 Mar 2008 16:19:39 +0000
Hi all,
I've noticed that when using layer backing on a NSTextField the font
becomes fuzzy - it seems that it switches from subpixel anti-aliasing
to normal. And indeed this seems to be the case. After reading
CATextLayer's documentation (assuming that NSTextField uses it to draw
its text), it becomes apparent that subpixel anti-aliasing cannot be
used with CATextLayer. Here's the exact wording:
"Note: CATextLayer disabled sub-pixel antialiasing when rendering
text. Text can only be drawn using sub-pixel antialiasing when it is
composited into an existing opaque background at the same time that
it's rasterized. There is no way to draw subpixel-anialiased text by
itself, whether into an image or a layer, separately in advance of
having the background pixels to weave the text pixels into. Setting
the opacityproperty of the layer to YES does not change the rendering
mode."
After reading the above note it looks to me that if the CATextLayer
has an opaque background, it should be able to use sub-pixel anti-
aliasing *if* we provide the background pixels in advance. The
question is, is it possible to do this? I tried setting the
backgroundColor property of a NSTextField's layer and it still
produced normal anti-aliased text as opposed to subpixel anti-aliased.
Has anyone else bumped into this issue?
I've also taken a sample screencast of the degradation of the quality
of the text when using layer backing on a NSTextField - http://www.doc.ic.ac.uk/~md207/ca_bugs/text_render/CA_text_render.mov
.
Kind regards,
Milen
_______________________________________________
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