Title: [114709] branches/chromium/1084/Source/WebCore/platform/graphics/chromium/UniscribeHelper.cpp
Revision
114709
Author
[email protected]
Date
2012-04-19 18:14:26 -0700 (Thu, 19 Apr 2012)

Log Message

Merge 114267 - [chromium] wrong justification for arabic/persian page in cr-win.
https://bugs.webkit.org/show_bug.cgi?id=83227

Reviewed by Kent Tamura.

Source/WebCore:

Disable kashida justification if using Skia to draw.

Test: fast/text/international/arabic-justify.html

* platform/graphics/chromium/UniscribeHelper.cpp:
(WebCore::UniscribeHelper::justify):

LayoutTests:

* fast/text/international/arabic-justify.html: Added.
* platform/chromium-win/fast/text/international/arabic-justify-expected.png: Added.
* platform/chromium-win/fast/text/international/arabic-justify-expected.txt: Added.
* platform/chromium/test_expectations.txt:
* platform/gtk/fast/text/international/arabic-justify-expected.txt: Added.
* platform/mac-snowleopard/fast/text/international/arabic-justify-expected.png: Added.
* platform/mac-snowleopard/fast/text/international/arabic-justify-expected.txt: Added.
* platform/mac/fast/text/international/arabic-justify-expected.txt: Added.
* platform/qt/fast/text/international/arabic-justify-expected.txt: Added.


[email protected]
Review URL: https://chromiumcodereview.appspot.com/10154002

Modified Paths

Diff

Modified: branches/chromium/1084/Source/WebCore/platform/graphics/chromium/UniscribeHelper.cpp (114708 => 114709)


--- branches/chromium/1084/Source/WebCore/platform/graphics/chromium/UniscribeHelper.cpp	2012-04-20 00:58:09 UTC (rev 114708)
+++ branches/chromium/1084/Source/WebCore/platform/graphics/chromium/UniscribeHelper.cpp	2012-04-20 01:14:26 UTC (rev 114709)
@@ -217,7 +217,18 @@
 
     // The documentation for Scriptjustify is wrong, the parameter is the space
     // to add and not the width of the column you want.
-    const int minKashida = 1;  // How do we decide what this should be?
+    int minKashida;
+#if USE(SKIA_TEXT)
+    // Disable kashida justification based on 
+    // http://blogs.msdn.com/b/michkap/archive/2010/08/31/10056140.aspx.
+    for (int i = 0; i < totalGlyphs; ++i) {
+        if (visualAttributes[i].uJustification == SCRIPT_JUSTIFY_ARABIC_KASHIDA)
+            visualAttributes[i].uJustification = SCRIPT_JUSTIFY_NONE;   
+    }
+    minKashida = 0;
+#else
+    minKashida = 1; // How do we decide what this should be?
+#endif
     ScriptJustify(&visualAttributes[0], &advances[0], totalGlyphs,
                   additionalSpace, minKashida, &justify[0]);
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to