[HarfBuzz] Kerning at the end of a line vs. line breaks

Behdad Esfahbod behdad at behdad.org
Wed Oct 24 13:37:41 PDT 2012


On 12-10-24 12:07 PM, Konstantin Ritt wrote:
> Sounds wonderful, indeed.
> IIUC, this can't be done by simply looking for the glyph cluster run
> end, since in some languages the glyph could morph into some other one
> depending on the surrounding characters - is this correct?

Correct.

> BTW, is glyph cluster the same thing as Unicode's extended grapheme
> cluster (assuming one tailored the default algorithm the language of
> interest) ?
> Or more precise - could one use the glyph cluster boundaries produced
> by the text shaping instead of grapheme cluster boundaries calculated
> for the same text?

No and no.  Take the simple case of the "fi" ligature.  That's two grapheme
clusters and needs two cursor positions (one inside, one at the edge), but
since it's a single glyph, there's no way we can return Unicode grapheme
clusters from harfbuzz.

b


> Konstantin
> 
> 
> 2012/10/24 Lóránt Pintér <lorant.pinter at prezi.com>:
>> Having this would be wonderful. Is there a plan to do this in the near
>> future, maybe before 1.0?
>>
>> --
>> Lorant
>>
>> On Wednesday, October 24, 2012 at 6:23 PM, Behdad Esfahbod wrote:
>>
>> On 12-10-23 10:43 PM, Konstantin Ritt wrote:
>>
>> 2012/10/23 Behdad Esfahbod <behdad at behdad.org>:
>>
>> On 12-10-17 08:22 PM, Lóránt Pintér wrote:
>>
>>
>> This could work, but I would basically have to shape the whole text twice.
>> That doesn't sound right. Or does it?
>>
>>
>> It actually is what you need to do, and what Pango does for example. Now, I
>> like to add API to HarfBuzz that would improve this, and you would
>> essentially
>> just need to reshape the cluster at the linebreak position, but for now, you
>> need to reshape each line.
>>
>> Are you saying about re-introducing the Unicode Segmentation algorithm
>> implementation to Harfbuzz? Hope you're not :)
>>
>>
>> No. Unicode segmentation algorithm is not really helpful here. What HarfBuzz
>> can tell you is this: for each position in the text, it can tell you whether
>> breaking the string here and shaping the two sides separately and
>> concatenating the resulting glyphstrings will result in the same glyphstring
>> that you get if you shape the full string. No other code can tell you that,
>> since it depends on how the font lookups work.
>>
>> behdad
>>
>> Konstantin
>>
>>
> 



More information about the HarfBuzz mailing list