Re: Pixel-perfect migration from ATSUI to Core Text
Re: Pixel-perfect migration from ATSUI to Core Text
- Subject: Re: Pixel-perfect migration from ATSUI to Core Text
- From: Alastair Houghton <email@hidden>
- Date: Thu, 01 Sep 2016 14:44:08 +0100
On 1 Sep 2016, at 14:38, Andreas Falkenhahn <email@hidden> wrote:
>
> The problem is most likely that the “W” doesn’t start at x = 0
>> (have you tried calling CTLineGetOffsetForStringIndex(line, 0, NULL)?)
>
> That returns 0, that's why I was using 1.
Hmmm. OK, well looking at the documentation I suppose that makes sense (that’s apparently supposed to be used for caret positioning, so it might not even equal the advance width in general; in particular, ligature glyphs may well cause you problems).
Have you tried getting the CTRun using CTLineGetGlyphRuns() and using CTRunGetPositions/CTRunGetAdvances()?
Kind regards,
Alastair.
--
http://alastairs-place.net
_______________________________________________
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