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.

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?).

The attached screenshots show the string:
بربربربربربربربربر
حوحوحوحوحوحو
rendered in Qt's sample textedit application, both before and after
applying the attached patch. The font used can be downloaded from SF:
http://sourceforge.net/projects/arabeyes/files/kacst_fonts/kacst_one_3.0.tar.bz2
 

Regards,
 Khaled

-- 
 Khaled Hosny
 Arabic localiser and member of Arabeyes.org team
 Free font developer
diff --git a/src/harfbuzz-shaper.cpp b/src/harfbuzz-shaper.cpp
index ce4d4ac..7d433ea 100644
--- a/src/harfbuzz-shaper.cpp
+++ b/src/harfbuzz-shaper.cpp
@@ -1263,7 +1263,7 @@ HB_Bool HB_OpenTypePosition(HB_ShaperItem *item, int availableGlyphs, HB_Bool do
 //                    (int)(positions[i].x_pos >> 6), (int)(positions[i].y_pos >> 6),
 //                    positions[i].back, positions[i].new_advance);
 
-            HB_Fixed adjustment = (item->item.bidiLevel % 2) ? -positions[i].x_advance : positions[i].x_advance;
+            HB_Fixed adjustment = positions[i].x_advance;
 
             if (!(face->current_flags & HB_ShaperFlag_UseDesignMetrics))
                 adjustment = HB_FIXED_ROUND(adjustment);

<<attachment: before.png>>

<<attachment: after.png>>

_______________________________________________
HarfBuzz mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/harfbuzz

Reply via email to