[HarfBuzz] HarfBuzz shaping of R2L text

Ebrahim Byagowi 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:

> Hi,
> 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)
> 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
> display.
> _______________________________________________
> HarfBuzz mailing list
> HarfBuzz at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/harfbuzz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/harfbuzz/attachments/20190529/4390a214/attachment.html>

More information about the HarfBuzz mailing list