Re: Obtaining baseline from CATextLayer
Re: Obtaining baseline from CATextLayer
- Subject: Re: Obtaining baseline from CATextLayer
- From: Kyle Sluder <email@hidden>
- Date: Sun, 10 Aug 2014 10:10:31 -0700
> On Aug 9, 2014, at 9:50 PM, Graham Cox <email@hidden> wrote:
>
> One of the things that bugs me about text on OS X is that it's laid out from the top edge of a bounding box, not based off a baseline.
Only if you use the legacy rendering methods. See NSStringDrawingUsesLineFragmentOrigin.
> Am I missing something more obvious, or is it really this hard?
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.
(Or maybe you don’t care about subpixel AA. We’ll all have Retina screens in 5 years anyway.)
--Kyle Sluder
_______________________________________________
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