Re: Pixel-perfect migration from ATSUI to Core Text

2016-09-01 Thread Quincey Morris
On Sep 1, 2016, at 10:53 , Andreas Falkenhahn wrote: > > Who said that the answer was clearly "no”? Me. And you. You took a trivially simple single-character example, and failed to come up with the same answer. > So far these attempts haven’t been successful but … You

Re: Pixel-perfect migration from ATSUI to Core Text

2016-09-01 Thread Andreas Falkenhahn
On 01.09.2016 at 19:19 Quincey Morris wrote: > On Sep 1, 2016, at 09:42 , Andreas Falkenhahn wrote: > I know but currently I'm just trying to replicate the exact ATSUI look > But why??? Your original reason was along the lines of “to see if I > could”, and the

Re: Pixel-perfect migration from ATSUI to Core Text

2016-09-01 Thread Quincey Morris
On Sep 1, 2016, at 09:42 , Andreas Falkenhahn wrote: > > I know but currently I'm just trying to replicate the exact ATSUI look But why??? Your original reason was along the lines of “to see if I could”, and the answer is clearly “no”. Now you’re just setting yourself

Re: Pixel-perfect migration from ATSUI to Core Text

2016-09-01 Thread Andreas Falkenhahn
On 01.09.2016 at 15:44 Alastair Houghton wrote: > On 1 Sep 2016, at 14:38, Andreas Falkenhahn 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

Re: Pixel-perfect migration from ATSUI to Core Text

2016-09-01 Thread Alastair Houghton
On 1 Sep 2016, at 14:38, Andreas Falkenhahn 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

Re: Pixel-perfect migration from ATSUI to Core Text

2016-09-01 Thread Andreas Falkenhahn
On 01.09.2016 at 10:00 Alastair Houghton wrote: > On 31 Aug 2016, at 19:24, Andreas Falkenhahn wrote: >> On 31.08.2016 at 20:08 Alastair Houghton wrote: >>> On 31 Aug 2016, at 15:52, Andreas Falkenhahn wrote: But I still don't understand

Re: Pixel-perfect migration from ATSUI to Core Text

2016-09-01 Thread Alastair Houghton
On 31 Aug 2016, at 19:24, Andreas Falkenhahn wrote: > > On 31.08.2016 at 20:08 Alastair Houghton wrote: > >> On 31 Aug 2016, at 15:52, Andreas Falkenhahn wrote: > >>> But I still don't understand how computing glyph positioning manually >>>

Re: Pixel-perfect migration from ATSUI to Core Text

2016-08-31 Thread Andreas Falkenhahn
On 31.08.2016 at 20:08 Alastair Houghton wrote: > On 31 Aug 2016, at 15:52, Andreas Falkenhahn 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

Re: Pixel-perfect migration from ATSUI to Core Text

2016-08-31 Thread Alastair Houghton
On 31 Aug 2016, at 15:52, Andreas Falkenhahn 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()

Re: Pixel-perfect migration from ATSUI to Core Text

2016-08-31 Thread Andreas Falkenhahn
On 31.08.2016 at 04:01 Ken Thomases wrote: > On Aug 30, 2016, at 8:47 AM, Andreas Falkenhahn > wrote: >>> That said, when drawing strings, there are the functions >>> CGContextSetShouldSubpixelPositionFonts() and >>> CGContextSetAllowsFontSubpixelPositioning(). Those

Re: Pixel-perfect migration from ATSUI to Core Text

2016-08-30 Thread Ken Thomases
On Aug 30, 2016, at 8:47 AM, Andreas Falkenhahn wrote: > >> That said, when drawing strings, there are the functions >> CGContextSetShouldSubpixelPositionFonts() and >> CGContextSetAllowsFontSubpixelPositioning(). Those can be used to >> turn off sub-pixel positioning of

Re: Pixel-perfect migration from ATSUI to Core Text

2016-08-30 Thread Andreas Falkenhahn
On 29.08.2016 at 17:46 Ken Thomases wrote: > On Aug 29, 2016, at 9:55 AM, Andreas Falkenhahn > wrote: >> I'm migrating some code from ATSUI to Core Text. It's pretty raw stuff, i.e. >> it does >> all the layouting itself and only uses ATSUI/Core Text to draw single

Re: Pixel-perfect migration from ATSUI to Core Text

2016-08-29 Thread Jens Alfke
> On Aug 29, 2016, at 8:46 AM, Ken Thomases wrote: > > First, this has nothing to do with Cocoa and so isn't appropriate for > Cocoa-Dev. There is a CoreText mailing list at lists.apple.com , I believe. —Jens

Re: Pixel-perfect migration from ATSUI to Core Text

2016-08-29 Thread Ken Thomases
On Aug 29, 2016, at 9:55 AM, Andreas Falkenhahn wrote: > > I'm migrating some code from ATSUI to Core Text. It's pretty raw stuff, i.e. > it does > all the layouting itself and only uses ATSUI/Core Text to draw single lines > of text to > raw pixel buffers and obtain

Pixel-perfect migration from ATSUI to Core Text

2016-08-29 Thread Andreas Falkenhahn
I'm migrating some code from ATSUI to Core Text. It's pretty raw stuff, i.e. it does all the layouting itself and only uses ATSUI/Core Text to draw single lines of text to raw pixel buffers and obtain measurements. The raw pixel data emitted by ATSUDrawText() and CTLineDraw() seems to match