• 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: Pixel-perfect migration from ATSUI to Core Text
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Pixel-perfect migration from ATSUI to Core Text
      • From: Andreas Falkenhahn <email@hidden>
References: 
 >Re: Pixel-perfect migration from ATSUI to Core Text (From: Alastair Houghton <email@hidden>)
 >Re: Pixel-perfect migration from ATSUI to Core Text (From: Andreas Falkenhahn <email@hidden>)

  • Prev by Date: Re: Pixel-perfect migration from ATSUI to Core Text
  • Next by Date: Re: Pixel-perfect migration from ATSUI to Core Text
  • Previous by thread: Re: Pixel-perfect migration from ATSUI to Core Text
  • Next by thread: Re: Pixel-perfect migration from ATSUI to Core Text
  • Index(es):
    • Date
    • Thread