Title: [114187] trunk/Source/WebCore
Revision
114187
Author
[email protected]
Date
2012-04-13 17:33:09 -0700 (Fri, 13 Apr 2012)

Log Message

REGRESSION(r102190) [chromium] text rendering (font and font size) in some Arabic/Persian page is wrong
when using certain fonts
https://bugs.webkit.org/show_bug.cgi?id=83523

Reviewed by Kent Tamura.

Revert r102190.
Convert characters being treatAsSpace to white space.

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

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (114186 => 114187)


--- trunk/Source/WebCore/ChangeLog	2012-04-14 00:27:34 UTC (rev 114186)
+++ trunk/Source/WebCore/ChangeLog	2012-04-14 00:33:09 UTC (rev 114187)
@@ -1,3 +1,18 @@
+2012-04-13  Xiaomei Ji  <[email protected]>
+
+        REGRESSION(r102190) [chromium] text rendering (font and font size) in some Arabic/Persian page is wrong
+        when using certain fonts
+        https://bugs.webkit.org/show_bug.cgi?id=83523
+
+        Reviewed by Kent Tamura.
+
+        Revert r102190.
+        Convert characters being treatAsSpace to white space. 
+
+        * platform/graphics/chromium/UniscribeHelper.cpp:
+        (WebCore::UniscribeHelper::fillRuns):
+        (WebCore::UniscribeHelper::adjustSpaceAdvances):
+
 2012-04-13  Timothy Hatcher  <[email protected]>
 
         Change how the Web Insector is installed on Mac builds.

Modified: trunk/Source/WebCore/platform/graphics/chromium/UniscribeHelper.cpp (114186 => 114187)


--- trunk/Source/WebCore/platform/graphics/chromium/UniscribeHelper.cpp	2012-04-14 00:27:34 UTC (rev 114186)
+++ trunk/Source/WebCore/platform/graphics/chromium/UniscribeHelper.cpp	2012-04-14 00:33:09 UTC (rev 114187)
@@ -541,7 +541,7 @@
                                            0, // fNeutralOverride    :1;
                                            0, // fNumericOverride    :1;
                                            0, // fLegacyBidiClass    :1;
-                                           1, // fMergeNeutralItems  :1;
+                                           0, // fMergeNeutralItems  :1;
                                            0};// fReserved           :7;
     // Calling ScriptApplyDigitSubstitution( 0, &inputControl, &inputState)
     // here would be appropriate if we wanted to set the language ID, and get
@@ -575,6 +575,24 @@
                                             &inputControl, &inputState,
                                             &m_runs[0], &m_scriptTags[0],
                                             &numberOfItems);
+
+            if (SUCCEEDED(hr)) { 
+                // Pack consecutive runs, the script tag of which are 
+                // SCRIPT_TAG_UNKNOWN, to reduce the number of runs. 
+                for (int i = 0; i < numberOfItems; ++i) { 
+                    if (m_scriptTags[i] == SCRIPT_TAG_UNKNOWN) { 
+                        int j = 1; 
+                        while (i + j < numberOfItems && m_scriptTags[i + j] == SCRIPT_TAG_UNKNOWN) 
+                            ++j; 
+                        if (--j) { 
+                            m_runs.remove(i + 1, j); 
+                            m_scriptTags.remove(i + 1, j); 
+                            numberOfItems -= j; 
+                        } 
+                    } 
+                } 
+                m_scriptTags.resize(numberOfItems); 
+            } 
         } else {
             hr = ScriptItemize(m_input, m_inputLength,
                                static_cast<int>(m_runs.size()) - 1,
@@ -892,6 +910,8 @@
             int glyphIndex = shaping.m_logs[i];
             int currentAdvance = shaping.m_advance[glyphIndex];
 
+            shaping.m_glyphs[glyphIndex] = shaping.m_spaceGlyph;
+
             if (treatAsSpace) {
                 // currentAdvance does not include additional letter-spacing,
                 // but m_spaceWidth does. Here we find out how off we are from
@@ -913,7 +933,6 @@
             shaping.m_abc.abcB -= currentAdvance;
             shaping.m_offsets[glyphIndex].du = 0;
             shaping.m_offsets[glyphIndex].dv = 0;
-            shaping.m_glyphs[glyphIndex] = shaping.m_spaceGlyph;
         }
     }
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to