[HarfBuzz] Using Harfbuzz & ICU & Glyphy in OpenES2 Engine

Khaled Hosny khaledhosny at eglug.org
Thu Feb 13 09:32:32 CET 2014


On Thu, Feb 13, 2014 at 11:54:03AM +0700, James Clark wrote:
> On Thu, Feb 13, 2014 at 5:48 AM, Behdad Esfahbod <behdad at behdad.org> wrote:
> 
> >
> > In short: You shape the whole paragraph using HarfBuzz, then create a
> > line-break iterator with ICU and walk the text and glyph string together
> > and
> > find the best break opportunity to fill the line.  That can be
> > mid-HarfBuzz-cluster.  After that, you reshape the line, but can continue
> > with
> > the original shaped-paragraph for the next lines.
> >
> 
> I was wondering how this is supposed to deal with hyphenated Arabic text.
> The css3-text spec says: "When shaping scripts such as Arabic are allowed
> to break within words due to hyphenation, the characters must still be
> shaped as if the word were not broken."  When the line after the hyphenated
> break is reshaped, how do you get the first character to be shaped as a
> medial rather than an initial?

If you supply HarfBuzz with enough context (e.g. pass the string of the
whole paragraph to the buffer, specifying starting index and length
instead of just the string representing the line) then HarfBuzz will
choose the proper Arabic shape. Arabic is rarely “hyphenated” that way,
though (AFAIK only Uighur allow this).

Regards,
Khaled


More information about the HarfBuzz mailing list