Title: [129176] trunk
Revision
129176
Author
[email protected]
Date
2012-09-20 16:19:43 -0700 (Thu, 20 Sep 2012)

Log Message

Kerning never occurs between a space and the following glyph
https://bugs.webkit.org/show_bug.cgi?id=97269

Reviewed by Tim Horton.

Source/WebCore: 

Covered by several existing tests.

* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::ComplexTextController::adjustGlyphsAndAdvances): Changed to not reset the advance
of a space, and added a comment about how this also needs to be fixed for other characters
that are treated as spaces.

LayoutTests: 

* platform/mac/fast/text/emphasis-expected.png:
* platform/mac/fast/text/emphasis-expected.txt:
* platform/mac/fast/text/sticky-typesetting-features-expected.png:
* platform/mac/fast/text/sticky-typesetting-features-expected.txt:
* platform/mac/fast/text/thai-combining-mark-positioning-expected.png:
* platform/mac/fast/text/thai-combining-mark-positioning-expected.txt:
* platform/mac/fast/writing-mode/text-orientation-basic-expected.png:
* platform/mac/fast/writing-mode/text-orientation-basic-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (129175 => 129176)


--- trunk/LayoutTests/ChangeLog	2012-09-20 23:16:16 UTC (rev 129175)
+++ trunk/LayoutTests/ChangeLog	2012-09-20 23:19:43 UTC (rev 129176)
@@ -1,3 +1,19 @@
+2012-09-20  Dan Bernstein  <[email protected]>
+
+        Kerning never occurs between a space and the following glyph
+        https://bugs.webkit.org/show_bug.cgi?id=97269
+
+        Reviewed by Tim Horton.
+
+        * platform/mac/fast/text/emphasis-expected.png:
+        * platform/mac/fast/text/emphasis-expected.txt:
+        * platform/mac/fast/text/sticky-typesetting-features-expected.png:
+        * platform/mac/fast/text/sticky-typesetting-features-expected.txt:
+        * platform/mac/fast/text/thai-combining-mark-positioning-expected.png:
+        * platform/mac/fast/text/thai-combining-mark-positioning-expected.txt:
+        * platform/mac/fast/writing-mode/text-orientation-basic-expected.png:
+        * platform/mac/fast/writing-mode/text-orientation-basic-expected.txt:
+
 2012-09-20  Kenichi Ishibashi  <[email protected]>
 
         [Chromium] Improve glyph selection of HarfBuzzShaper

Modified: trunk/LayoutTests/platform/mac/fast/text/emphasis-expected.png


(Binary files differ)

Modified: trunk/LayoutTests/platform/mac/fast/text/emphasis-expected.txt (129175 => 129176)


--- trunk/LayoutTests/platform/mac/fast/text/emphasis-expected.txt	2012-09-20 23:16:16 UTC (rev 129175)
+++ trunk/LayoutTests/platform/mac/fast/text/emphasis-expected.txt	2012-09-20 23:19:43 UTC (rev 129176)
@@ -25,9 +25,9 @@
         RenderInline {SPAN} at (0,0) size 217x28
           RenderText {#text} at (3,45) size 217x28
             text run at (3,45) width 217: "consectetur adipiscing"
-        RenderText {#text} at (220,45) size 135x28
+        RenderText {#text} at (220,45) size 134x28
           text run at (220,45) width 6: " "
-          text run at (226,45) width 129: "elit. Aliquam"
+          text run at (226,45) width 128: "elit. Aliquam"
         RenderInline {SPAN} at (0,0) size 111x28
           RenderText {#text} at (3,73) size 111x28
             text run at (3,73) width 111: "odio sa\x{300}pien"

Modified: trunk/LayoutTests/platform/mac/fast/text/sticky-typesetting-features-expected.png


(Binary files differ)

Modified: trunk/LayoutTests/platform/mac/fast/text/sticky-typesetting-features-expected.txt (129175 => 129176)


--- trunk/LayoutTests/platform/mac/fast/text/sticky-typesetting-features-expected.txt	2012-09-20 23:16:16 UTC (rev 129175)
+++ trunk/LayoutTests/platform/mac/fast/text/sticky-typesetting-features-expected.txt	2012-09-20 23:19:43 UTC (rev 129176)
@@ -13,5 +13,5 @@
         RenderText {#text} at (0,0) size 324x18
           text run at (0,0) width 324: "This should be rendered with kerning and ligatures:"
       RenderBlock {DIV} at (0,250) size 784x166
-        RenderText {#text} at (0,0) size 754x166
-          text run at (0,0) width 754: "Office Today"
+        RenderText {#text} at (0,0) size 751x166
+          text run at (0,0) width 751: "Office Today"

Modified: trunk/LayoutTests/platform/mac/fast/text/thai-combining-mark-positioning-expected.png


(Binary files differ)

Modified: trunk/LayoutTests/platform/mac/fast/text/thai-combining-mark-positioning-expected.txt (129175 => 129176)


--- trunk/LayoutTests/platform/mac/fast/text/thai-combining-mark-positioning-expected.txt	2012-09-20 23:16:16 UTC (rev 129175)
+++ trunk/LayoutTests/platform/mac/fast/text/thai-combining-mark-positioning-expected.txt	2012-09-20 23:19:43 UTC (rev 129176)
@@ -4,5 +4,5 @@
   RenderBlock {HTML} at (0,0) size 800x600
     RenderBody {BODY} at (8,8) size 784x584
       RenderBlock {DIV} at (0,0) size 784x101
-        RenderText {#text} at (0,0) size 384x101
-          text run at (0,0) width 384: "\x{E43}\x{E2B}\x{E49}\x{E21}\x{E35}\x{E02}\x{E36}\x{E49}\x{E19} \x{E01}\x{E32}\x{E23}\x{E17}\x{E4D}\x{E32}\x{E43}\x{E2B}\x{E49}"
+        RenderText {#text} at (0,0) size 385x101
+          text run at (0,0) width 385: "\x{E43}\x{E2B}\x{E49}\x{E21}\x{E35}\x{E02}\x{E36}\x{E49}\x{E19} \x{E01}\x{E32}\x{E23}\x{E17}\x{E4D}\x{E32}\x{E43}\x{E2B}\x{E49}"

Modified: trunk/LayoutTests/platform/mac/fast/writing-mode/text-orientation-basic-expected.png


(Binary files differ)

Modified: trunk/LayoutTests/platform/mac/fast/writing-mode/text-orientation-basic-expected.txt (129175 => 129176)


--- trunk/LayoutTests/platform/mac/fast/writing-mode/text-orientation-basic-expected.txt	2012-09-20 23:16:16 UTC (rev 129175)
+++ trunk/LayoutTests/platform/mac/fast/writing-mode/text-orientation-basic-expected.txt	2012-09-20 23:19:43 UTC (rev 129176)
@@ -49,8 +49,8 @@
             RenderText {#text} at (94,1) size 36x197
               text run at (94,1) width 197: "Hello world"
           RenderBR {BR} at (112,198) size 0x0
-          RenderInline {SPAN} at (0,0) size 36x221
-            RenderText {#text} at (148,1) size 36x221
-              text run at (148,1) width 221: "Hello world"
-          RenderBR {BR} at (166,222) size 0x0
+          RenderInline {SPAN} at (0,0) size 36x197
+            RenderText {#text} at (148,1) size 36x197
+              text run at (148,1) width 197: "Hello world"
+          RenderBR {BR} at (166,198) size 0x0
         RenderText {#text} at (0,0) size 0x0

Modified: trunk/Source/WebCore/ChangeLog (129175 => 129176)


--- trunk/Source/WebCore/ChangeLog	2012-09-20 23:16:16 UTC (rev 129175)
+++ trunk/Source/WebCore/ChangeLog	2012-09-20 23:19:43 UTC (rev 129176)
@@ -1,3 +1,17 @@
+2012-09-20  Dan Bernstein  <[email protected]>
+
+        Kerning never occurs between a space and the following glyph
+        https://bugs.webkit.org/show_bug.cgi?id=97269
+
+        Reviewed by Tim Horton.
+
+        Covered by several existing tests.
+
+        * platform/graphics/mac/ComplexTextController.cpp:
+        (WebCore::ComplexTextController::adjustGlyphsAndAdvances): Changed to not reset the advance
+        of a space, and added a comment about how this also needs to be fixed for other characters
+        that are treated as spaces.
+
 2012-09-20  Kenichi Ishibashi  <[email protected]>
 
         [Chromium] Improve glyph selection of HarfBuzzShaper

Modified: trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp (129175 => 129176)


--- trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp	2012-09-20 23:16:16 UTC (rev 129175)
+++ trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp	2012-09-20 23:19:43 UTC (rev 129176)
@@ -580,8 +580,14 @@
                 nextCh = *(m_complexTextRuns[r + 1]->characters() + m_complexTextRuns[r + 1]->indexAt(0));
 
             bool treatAsSpace = Font::treatAsSpace(ch);
-            CGGlyph glyph = treatAsSpace ? fontData->spaceGlyph() : glyphs[i];
-            CGSize advance = treatAsSpace ? CGSizeMake(spaceWidth, advances[i].height) : advances[i];
+            CGGlyph glyph = glyphs[i];
+            CGSize advance = advances[i];
+            // FIXME: We should find a way to substitute spaces for characters that are treated as spaces
+            // before handing them off to Core Text, so that kerning can be applied as if they were spaces.
+            if (treatAsSpace && ch != ' ') {
+                glyph = fontData->spaceGlyph();
+                advance.width = spaceWidth;
+            }
 
             if (ch == '\t' && m_run.allowTabs())
                 advance.width = m_font.tabWidth(*fontData, m_run.tabSize(), m_run.xPos() + m_totalWidth + widthSinceLastCommit);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to