• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Obtaining baseline from CATextLayer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Obtaining baseline from CATextLayer
      • From: Graham Cox <email@hidden>
References: 
 >Obtaining baseline from CATextLayer (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: Bindings in Swift
  • Next by Date: Re: Bindings in Swift
  • Previous by thread: Obtaining baseline from CATextLayer
  • Next by thread: Re: Obtaining baseline from CATextLayer
  • Index(es):
    • Date
    • Thread