Re: Obtaining baseline from CATextLayer
Re: Obtaining baseline from CATextLayer
- Subject: Re: Obtaining baseline from CATextLayer
- From: Graham Cox <email@hidden>
- Date: Mon, 11 Aug 2014 11:50:16 +1000
On 11 Aug 2014, at 3:10 am, Kyle Sluder <email@hidden> wrote:
> CATextLayer is pretty much useless. You’re far better off rendering the text yourself using Quartz.
>
> Do it in -displayLayer, not -drawLayer:inContext:, because you want to create the backing store yourself to get correct subpixel antialiasing. Specifically, you want to render into a context with 32-bit premultiplied alpha and host byte ordering, and you want to fill the backing store with an opaque color before you render text.
Thanks - I'd come to the conclusion that writing my own could end up being the best way to solve it, though I'm always reluctant to jump to that conclusion. It's a pity, because other than these alignment issues, CATextLayer is adequate for my needs. The subpixel-AA is 'nice to have' but for my immediate needs not really necessary nor easy to achieve, as I'm rendering the text using a transparent background over a variable image in another layer.
--Graham
_______________________________________________
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