[HarfBuzz] harfbuzz.old applies x advances for rtl in the wrong direction
Jjgod Jiang
gzjjgod at gmail.com
Thu Jan 13 10:27:53 PST 2011
On Thu, Jan 13, 2011 at 6:37 PM, Khaled Hosny <khaledhosny at eglug.org> wrote:
> X glyph advances should always be applied from left to right regardless
> of text direction, however HarfBuzz code used in Qt applies X advances
> in negative if text direction is right to left which breaks Arabic
> kerning for example.
Are you sure about "X glyph advances should always be applied
from left to right"? Can you please point me out which part of
OpenType spec states that? I was checking [1] but couldn't
find it.
As a side note, harfbuzz-ng is also using the same way as
harfbuzz, see line 1536 to 1545 in hb-ot-layout-gpos-private.hh:
1536 if (HB_DIRECTION_IS_BACKWARD (buffer->props.direction))
1537 for (j = back + 1; j < i + 1; j++) {
1538 pos[i].x_offset += pos[j].x_advance;
1539 pos[i].y_offset += pos[j].y_advance;
1540 }
1541 else
1542 for (j = back; j < i; j++) {
1543 pos[i].x_offset -= pos[j].x_advance;
1544 pos[i].y_offset -= pos[j].y_advance;
1545 }
> This have been reported against Qt:
> http://bugreports.qt.nokia.com/browse/QTBUG-4475
> And though the issue was closed as not being reproducible, I can still
> reproduce it (may be Qt on Windows does not use HB?).
Qt on Windows does use HB for shaping.
> The attached screenshots show the string:
> بربربربربربربربربر
> حوحوحوحوحوحو
Unfortunately I can't even reproduce the "after" screenshot with the
font installed from your link with the Mac OS X native TextEdit, see
[2], while the result looks correct with other Arabic fonts I have
(Geeza Pro, etc.). Could that mean the font itself has some problems?
- Jiang
[1] http://www.adobe.com/devnet/opentype/afdko/topic_feature_file_syntax.html
[2] http://d.pr/piCx
More information about the HarfBuzz
mailing list