On 01.09.2016 at 10:00 Alastair Houghton wrote:

> On 31 Aug 2016, at 19:24, Andreas Falkenhahn <andr...@falkenhahn.com> wrote:

>> On 31.08.2016 at 20:08 Alastair Houghton wrote:

>>> On 31 Aug 2016, at 15:52, Andreas Falkenhahn <andr...@falkenhahn.com> wrote:

>>>> But I still don't understand how computing glyph positioning manually
>>>> should work around the fact that there are no APIs that measure the text
>>>> like ATSUI. I mean, internally, CTLineGetOffsetForStringIndex() probably
>>>> does exactly that, it returns the positioning obtained from 
>>>> CTRunGetAdvances().

>>> You need to get the advances of individual glyphs, and sum the rounded 
>>> values.

>> Look at the example code I posted. It's just a single glyph in the string.
>> The string is just a "W”.

> 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.

-- 
Best regards,
 Andreas Falkenhahn                            mailto:andr...@falkenhahn.com


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to