Re: [HarfBuzz] Fwd: Harfbuzz with linebreaking

2016-06-15 Thread Khaled Hosny
On Wed, Jun 15, 2016 at 09:29:34AM +0700, Martin Hosken wrote: >I would suggest that you don't need to reshape if the start > of the next line is in a different cluster to the end of the previous > line. There are cases where you may need to do some positional tidying > (deciding where

Re: [HarfBuzz] Fwd: Harfbuzz with linebreaking

2016-06-14 Thread Kelvin Ma
Okay, so…supposing we had safe-to-break, would this system work?: The input string is this (where 'REVERSED TEXT' is a piece of right to left text): 'Tree Paine’s primary office is in Nashville (REVERSED TEXT). She works as a publicist.' This gets split into same-direction segments →

Re: [HarfBuzz] Fwd: Harfbuzz with linebreaking

2016-06-14 Thread kelvinsthirteen
> On Jun 14, 2016, at 1:29 AM, Simon Cozens wrote: > >> On 14/06/2016 14:23, kelvinsthirt...@gmail.com wrote: >> each word has at least >> one (often many) breakpoints, but only one of them gets used per >> line. > > Right. > >> And the only way to know which one to

Re: [HarfBuzz] Fwd: Harfbuzz with linebreaking

2016-06-13 Thread Simon Cozens
On 14/06/2016 14:23, kelvinsthirt...@gmail.com wrote: > each word has at least > one (often many) breakpoints, but only one of them gets used per > line. Right. > And the only way to know which one to use is to shape. Well, no. You shaped already; that was the first thing you did. As Adam told

Re: [HarfBuzz] Fwd: Harfbuzz with linebreaking

2016-06-13 Thread kelvinsthirteen
No, shaping does tell you about breakpoints in the same way that shaping can link back to original character indexes for any other purpose. For example, if the shaped sentence "make a difference!" overflows at the glyph “ff”, I know to test break points that come before the 11th character in

Re: [HarfBuzz] Fwd: Harfbuzz with linebreaking

2016-06-13 Thread Simon Cozens
On 14/06/2016 13:16, Kelvin Ma wrote: > The problem is, I have no idea where, in terms of x-coordinate, any of > these breakpoints are going to be until I shape them. So I will have to > shape the entire sentence. You do have to shape the entire sentence, yes. But that's got nothing to do with

Re: [HarfBuzz] Fwd: Harfbuzz with linebreaking

2016-06-13 Thread Kelvin Ma
On Mon, Jun 13, 2016 at 10:53 PM, Simon Cozens wrote: > On 14/06/2016 12:42, Kelvin Ma wrote: > > What I need is something to bridge that gap between the 1-line of > > unbroken text that harfbuzz generates, and the fragments I need to be > > able to assemble a multi-line

[HarfBuzz] Fwd: Harfbuzz with linebreaking

2016-06-13 Thread Kelvin Ma
Also this might be jumping the gun a bit since we still don’t even have the “safe-to-break” thing yet but how do we know when it’s okay to reshape a broken segment or if it should just be moved to the next line? A ligature like “ffi” can and should be broken into “f” and “fi” if needed (like

[HarfBuzz] Fwd: Harfbuzz with linebreaking

2016-06-13 Thread Kelvin Ma
What I need is something to bridge that gap between the 1-line of unbroken text that harfbuzz generates, and the fragments I need to be able to assemble a multi-line paragraph. What Freetype does is give me images of individual letters, which I can then put together to make words and sentences,