[HarfBuzz] HarfBuzz shaping of R2L text
ebraminio at gmail.com
Wed May 29 19:14:17 UTC 2019
That is expected and reliable in harfbuzz, you can use hb_buffer_reverse
however, AFAIK that is the way font designer are arranging their glyph
order in gsub/gpos for RTL (never seen R2L, better to use RTL AFAIK) and
harfbuzz is just using the order that is used in fonts data anyway.
On Wednesday, May 29, 2019, Eli Zaretskii <eliz at gnu.org> wrote:
> While testing the results of hb_shape_full called to shape R2L text, I
> observed behavior that surprised me: shaping an R2L base letter with a
> diacritical produces a sequence of glyphs in reverse order, i.e. the
> glyph for the diacritical comes first, before the base letter.
> For example, if I shape the sequence (in the logical order)
> U+05EA HEBREW LETTER TAV
> U+05BB HEBREW POINT QUBUTS
> the glyphs left in the buffer by the shaper are in reverse order,
> first QUBUTS, then TAV. I thought that this was because of bidi
> reordering, but the result doesn't change if I set the buffer
> direction to LTR before calling the shaper. The order of the clusters
> does change with the direction, i.e. with LTR the first cluster is
> zero, followed by 1, etc., whereas with RTL the clusters are in the
> decreasing order. But the glyphs are always in the same order: the
> point first, then the letter.
> I see the same with the Arabic script if I shape U+0633 followed by
> U+0651 (in logical order).
> This doesn't happen with LTR text in unidirectional scripts, including
> with Latin text when shaping a base letter followed by a diacritical.
> Is this expected behavior? If so, what are the reasons? Also, can it
> be controlled by the client application? E.g., Uniscribe can be told
> to produce glyphs in the logical order, after shaping them for RTL
> HarfBuzz mailing list
> HarfBuzz at lists.freedesktop.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the HarfBuzz