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.<div><br>On Wednesday, May 29, 2019, Eli Zaretskii <<a href="mailto:eliz@gnu.org">eliz@gnu.org</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
While testing the results of hb_shape_full called to shape R2L text, I<br>
observed behavior that surprised me: shaping an R2L base letter with a<br>
diacritical produces a sequence of glyphs in reverse order, i.e. the<br>
glyph for the diacritical comes first, before the base letter.<br>
<br>
For example, if I shape the sequence (in the logical order)<br>
<br>
  U+05EA HEBREW LETTER TAV<br>
  U+05BB HEBREW POINT QUBUTS<br>
<br>
the glyphs left in the buffer by the shaper are in reverse order,<br>
first QUBUTS, then TAV.  I thought that this was because of bidi<br>
reordering, but the result doesn't change if I set the buffer<br>
direction to LTR before calling the shaper.  The order of the clusters<br>
does change with the direction, i.e. with LTR the first cluster is<br>
zero, followed by 1, etc., whereas with RTL the clusters are in the<br>
decreasing order.  But the glyphs are always in the same order: the<br>
point first, then the letter.<br>
<br>
I see the same with the Arabic script if I shape U+0633 followed by<br>
U+0651 (in logical order).<br>
<br>
This doesn't happen with LTR text in unidirectional scripts, including<br>
with Latin text when shaping a base letter followed by a diacritical.<br>
<br>
Is this expected behavior?  If so, what are the reasons?  Also, can it<br>
be controlled by the client application?  E.g., Uniscribe can be told<br>
to produce glyphs in the logical order, after shaping them for RTL<br>
display.<br>
<br>
TIA<br>
______________________________<wbr>_________________<br>
HarfBuzz mailing list<br>
<a href="mailto:HarfBuzz@lists.freedesktop.org">HarfBuzz@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/harfbuzz" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/harfbuzz</a></blockquote></div>