[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.19-706-ge5415e9

evan at chromium.org evan at chromium.org
Thu Feb 4 21:31:27 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit fee8bc3eb84e6cba1cc811a11db0d4b04f63a765
Author: evan at chromium.org <evan at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Jan 28 22:17:23 2010 +0000

    2010-01-27  Evan Martin  <evan at chromium.org>
    
            Reviewed by David Levin.
    
            [chromium] hebrew vowel marks incorrectly positioned
            https://bugs.webkit.org/show_bug.cgi?id=34234
    
            Add a layout test containing some Hebrew vowels.
    
            * fast/text/international/hebrew-vowels.html: Added.
    2010-01-27  Evan Martin  <evan at chromium.org>
    
            Reviewed by David Levin.
    
            [chromium] hebrew vowel marks incorrectly positioned
            https://bugs.webkit.org/show_bug.cgi?id=34234
    
            Fix glyph metrics computation such that the glyph offsets
            are correct, so we can now make use of them.
    
            Test: fast/text/international/hebrew-vowels.html
    
            * platform/graphics/chromium/FontLinux.cpp:
            (WebCore::TextRunWalker::createGlyphArrays): initialize per-glyph
            offset table.
            (WebCore::TextRunWalker::setGlyphXPositions): use per-glyph
            offsets.
            * platform/graphics/chromium/HarfbuzzSkia.cpp:
            (WebCore::getGlyphMetrics): fix metrics computation such that
            per-glyph offsets are computed correctly.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54020 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 94e9ca6..15cdffe 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,14 @@
+2010-01-27  Evan Martin  <evan at chromium.org>
+
+        Reviewed by David Levin.
+
+        [chromium] hebrew vowel marks incorrectly positioned
+        https://bugs.webkit.org/show_bug.cgi?id=34234
+
+        Add a layout test containing some Hebrew vowels.
+
+        * fast/text/international/hebrew-vowels.html: Added.
+
 2010-01-28  Dimitri Glazkov  <dglazkov at chromium.org>
 
         Unreviewed, trivial baseline update.
diff --git a/LayoutTests/fast/text/international/hebrew-vowels.html b/LayoutTests/fast/text/international/hebrew-vowels.html
new file mode 100644
index 0000000..dd91087
--- /dev/null
+++ b/LayoutTests/fast/text/international/hebrew-vowels.html
@@ -0,0 +1,19 @@
+<p>This test covers Hebrew vowel positioning.</p>
+
+<hr>
+
+<p>The vowel (two vertical dots) should be centered beneath the main
+letter.</p>
+<div style='font-size:500%'>
+&#x5e1;&#x5b0; <!-- HEBREW LETTER SAMEKH, HEBREW POINT SHEVA -->
+&#x5e9;&#x5b0; <!-- HEBREW LETTER SHIN, HEBREW POINT SHEVA -->
+</div>
+
+<hr>
+
+<p>The dot should be positioned on the right side of the first letter,
+and on the left side of the second one.</p>
+<div style='font-size:500%'>
+&#x5e9;&#x5c1;<br>  <!-- HEBREW LETTER SHIN, HEBREW POINT SHIN DOT -->
+&#x5e9;&#x5c2;  <!-- HEBREW LETTER SHIN, HEBREW POINT SIN DOT -->
+</div>
diff --git a/LayoutTests/platform/mac/fast/text/international/hebrew-vowels-expected.checksum b/LayoutTests/platform/mac/fast/text/international/hebrew-vowels-expected.checksum
new file mode 100644
index 0000000..0deec61
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/text/international/hebrew-vowels-expected.checksum
@@ -0,0 +1 @@
+ed9f22823b18c07d3235c4fefeb74a44
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/text/international/hebrew-vowels-expected.png b/LayoutTests/platform/mac/fast/text/international/hebrew-vowels-expected.png
new file mode 100644
index 0000000..6cdfacd
Binary files /dev/null and b/LayoutTests/platform/mac/fast/text/international/hebrew-vowels-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/text/international/hebrew-vowels-expected.txt b/LayoutTests/platform/mac/fast/text/international/hebrew-vowels-expected.txt
new file mode 100644
index 0000000..c57bd91
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/text/international/hebrew-vowels-expected.txt
@@ -0,0 +1,29 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock {P} at (0,0) size 784x18
+        RenderText {#text} at (0,0) size 274x18
+          text run at (0,0) width 274: "This test covers Hebrew vowel positioning."
+      RenderBlock {HR} at (0,34) size 784x2 [border: (1px inset #000000)]
+      RenderBlock {P} at (0,52) size 784x18
+        RenderText {#text} at (0,0) size 458x18
+          text run at (0,0) width 458: "The vowel (two vertical dots) should be centered beneath the main letter."
+      RenderBlock {DIV} at (0,86) size 784x97
+        RenderText {#text} at (58,5) size 74x92
+          text run at (58,5) width 74 RTL: "\x{5E1}\x{5B0} "
+        RenderText {#text} at (0,5) size 58x92
+          text run at (0,5) width 58 RTL: "\x{5E9}\x{5B0}"
+        RenderText {#text} at (0,0) size 0x0
+      RenderBlock {HR} at (0,191) size 784x2 [border: (1px inset #000000)]
+      RenderBlock {P} at (0,209) size 784x18
+        RenderText {#text} at (0,0) size 637x18
+          text run at (0,0) width 637: "The dot should be positioned on the right side of the first letter, and on the left side of the second one."
+      RenderBlock {DIV} at (0,243) size 784x194
+        RenderText {#text} at (0,5) size 58x92
+          text run at (0,5) width 58 RTL: "\x{5E9}\x{5C1}"
+        RenderBR {BR} at (58,77) size 0x0
+        RenderText {#text} at (0,102) size 58x92
+          text run at (0,102) width 58 RTL: "\x{5E9}\x{5C2}"
+        RenderText {#text} at (0,0) size 0x0
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index e19c5ea..fe3ef08 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,24 @@
+2010-01-27  Evan Martin  <evan at chromium.org>
+
+        Reviewed by David Levin.
+
+        [chromium] hebrew vowel marks incorrectly positioned
+        https://bugs.webkit.org/show_bug.cgi?id=34234
+
+        Fix glyph metrics computation such that the glyph offsets
+        are correct, so we can now make use of them.
+
+        Test: fast/text/international/hebrew-vowels.html
+
+        * platform/graphics/chromium/FontLinux.cpp:
+        (WebCore::TextRunWalker::createGlyphArrays): initialize per-glyph
+        offset table.
+        (WebCore::TextRunWalker::setGlyphXPositions): use per-glyph
+        offsets.
+        * platform/graphics/chromium/HarfbuzzSkia.cpp:
+        (WebCore::getGlyphMetrics): fix metrics computation such that
+        per-glyph offsets are computed correctly.
+
 2010-01-28  Laszlo Gombos  <laszlo.1.gombos at nokia.com>
 
         Unreviewed build fix.
diff --git a/WebCore/platform/graphics/chromium/FontLinux.cpp b/WebCore/platform/graphics/chromium/FontLinux.cpp
index 0254366..e76eca8 100644
--- a/WebCore/platform/graphics/chromium/FontLinux.cpp
+++ b/WebCore/platform/graphics/chromium/FontLinux.cpp
@@ -400,6 +400,8 @@ private:
         m_item.attributes = new HB_GlyphAttributes[m_maxGlyphs];
         m_item.advances = new HB_Fixed[m_maxGlyphs];
         m_item.offsets = new HB_FixedPoint[m_maxGlyphs];
+        // HB_FixedPoint is a struct, so we must use memset to clear it.
+        memset(m_item.offsets, 0, m_maxGlyphs * sizeof(HB_FixedPoint));
         m_glyphs16 = new uint16_t[m_maxGlyphs];
         m_xPositions = new SkScalar[m_maxGlyphs];
 
@@ -436,18 +438,19 @@ private:
 
     void setGlyphXPositions(bool isRTL)
     {
-        m_pixelWidth = 0;
-        for (unsigned i = 0; i < m_item.num_glyphs; ++i) {
-            int index;
-            if (isRTL)
-                index = m_item.num_glyphs - (i + 1);
-            else
-                index = i;
+        double position = 0;
+        for (int iter = 0; iter < m_item.num_glyphs; ++iter) {
+            // Glyphs are stored in logical order, but for layout purposes we always go left to right.
+            int i = isRTL ? m_item.num_glyphs - iter - 1 : iter;
 
             m_glyphs16[i] = m_item.glyphs[i];
-            m_xPositions[index] = m_offsetX + m_pixelWidth;
-            m_pixelWidth += truncateFixedPointToInteger(m_item.advances[index]);
+            double offsetX = truncateFixedPointToInteger(m_item.offsets[i].x);
+            m_xPositions[i] = m_offsetX + position + offsetX;
+
+            double advance = truncateFixedPointToInteger(m_item.advances[i]);
+            position += advance;
         }
+        m_pixelWidth = position;
         m_offsetX += m_pixelWidth;
     }
 
diff --git a/WebCore/platform/graphics/chromium/HarfbuzzSkia.cpp b/WebCore/platform/graphics/chromium/HarfbuzzSkia.cpp
index 9fd09e1..be3b0d0 100644
--- a/WebCore/platform/graphics/chromium/HarfbuzzSkia.cpp
+++ b/WebCore/platform/graphics/chromium/HarfbuzzSkia.cpp
@@ -167,15 +167,16 @@ static void getGlyphMetrics(HB_Font hbFont, HB_Glyph glyph, HB_GlyphMetrics* met
     SkRect bounds;
     paint.getTextWidths(&glyph16, sizeof(glyph16), &width, &bounds);
 
-    metrics->x = SkiaScalarToHarfbuzzFixed(width);
+    metrics->x = SkiaScalarToHarfbuzzFixed(bounds.fLeft);
+    metrics->y = SkiaScalarToHarfbuzzFixed(bounds.fTop);
+    metrics->width = SkiaScalarToHarfbuzzFixed(bounds.width());
+    metrics->height = SkiaScalarToHarfbuzzFixed(bounds.height());
+
+    metrics->xOffset = SkiaScalarToHarfbuzzFixed(width);
     // We can't actually get the |y| correct because Skia doesn't export
     // the vertical advance. However, nor we do ever render vertical text at
     // the moment so it's unimportant.
-    metrics->y = 0;
-    metrics->width = SkiaScalarToHarfbuzzFixed(bounds.width());
-    metrics->height = SkiaScalarToHarfbuzzFixed(bounds.height());
-    metrics->xOffset = SkiaScalarToHarfbuzzFixed(bounds.fLeft);
-    metrics->yOffset = SkiaScalarToHarfbuzzFixed(bounds.fTop);
+    metrics->yOffset = 0;
 }
 
 static HB_Fixed getFontMetric(HB_Font hbFont, HB_FontMetric metric)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list