Re: Replacement for CGContextSelectFont ?
Re: Replacement for CGContextSelectFont ?
- Subject: Re: Replacement for CGContextSelectFont ?
- From: Graham Cox <email@hidden>
- Date: Sun, 18 Sep 2016 20:38:43 +1000
> On 18 Sep 2016, at 7:24 PM, Gabriel Zachmann <email@hidden> wrote:
>
> But if anyone could suggest modifications to make it better (e.g., remove a bug, make it simpler, or more future proof),
> I will greatly appreciate it.
Have you looked at or tried CATextLayer? It already does all of this internally - you just have to set up its font, size, string, etc.
Since you’re drawing this into a CALayer anyway, I think you’re going to lose the sub-pixel antialiasing that you get using Core Graphics. I think (but maybe misremembered) that CATextLayer does something to ensure that works. But even if it doesn’t, it’ll still be a better option than replicating its functionality.
—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