Title: [121645] trunk
Revision
121645
Author
[email protected]
Date
2012-07-01 17:08:47 -0700 (Sun, 01 Jul 2012)

Log Message

<rdar://problem/11785743> [mac] Non-BMP characters in vertical text appear as missing glyphs
https://bugs.webkit.org/show_bug.cgi?id=90349

Reviewed by Dean Jackson.

Source/WebCore: 

Test: platform/mac/fast/text/vertical-surrogate-pair.html

* platform/graphics/mac/GlyphPageTreeNodeMac.cpp:
(WebCore::GlyphPage::fill): When calling wkGetVerticalGlyphsForCharacters or
CTFontGetGlyphsForCharacters with a buffer consisting of surrogate pair, account for those
functions’ behavior of placing glyphs at indices corresponding to the first character of
each pair.

LayoutTests: 

* platform/mac/fast/text/vertical-surrogate-pair.html: Added.
* platform/mac/platform/mac/fast/text/vertical-surrogate-pair-expected.png: Added.
* platform/mac/platform/mac/fast/text/vertical-surrogate-pair-expected.txt: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (121644 => 121645)


--- trunk/LayoutTests/ChangeLog	2012-07-02 00:08:17 UTC (rev 121644)
+++ trunk/LayoutTests/ChangeLog	2012-07-02 00:08:47 UTC (rev 121645)
@@ -1,3 +1,14 @@
+2012-07-01  Dan Bernstein  <[email protected]>
+
+        <rdar://problem/11785743> [mac] Non-BMP characters in vertical text appear as missing glyphs
+        https://bugs.webkit.org/show_bug.cgi?id=90349
+
+        Reviewed by Dean Jackson.
+
+        * platform/mac/fast/text/vertical-surrogate-pair.html: Added.
+        * platform/mac/platform/mac/fast/text/vertical-surrogate-pair-expected.png: Added.
+        * platform/mac/platform/mac/fast/text/vertical-surrogate-pair-expected.txt: Added.
+
 2012-07-01  Kenichi Ishibashi  <[email protected]>
 
         Arabic shaping is incorrect if ZWNJ exist

Added: trunk/LayoutTests/platform/mac/fast/text/vertical-surrogate-pair.html (0 => 121645)


--- trunk/LayoutTests/platform/mac/fast/text/vertical-surrogate-pair.html	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/text/vertical-surrogate-pair.html	2012-07-02 00:08:47 UTC (rev 121645)
@@ -0,0 +1,8 @@
+<style>
+    div { font-family: 'hiragino mincho pro'; font-size: 48px; }
+</style>
+<p>
+    These two glyphs should look the same:
+</p>
+<div>&#x20b9f;</div>
+<div style="-webkit-writing-mode: vertical-lr;">&#x20b9f;</div>

Added: trunk/LayoutTests/platform/mac/platform/mac/fast/text/vertical-surrogate-pair-expected.png


(Binary files differ)
Property changes on: trunk/LayoutTests/platform/mac/platform/mac/fast/text/vertical-surrogate-pair-expected.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/platform/mac/platform/mac/fast/text/vertical-surrogate-pair-expected.txt (0 => 121645)


--- trunk/LayoutTests/platform/mac/platform/mac/fast/text/vertical-surrogate-pair-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/platform/mac/fast/text/vertical-surrogate-pair-expected.txt	2012-07-02 00:08:47 UTC (rev 121645)
@@ -0,0 +1,14 @@
+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 253x18
+          text run at (0,0) width 253: "These two glyphs should look the same:"
+      RenderBlock {DIV} at (0,34) size 784x72
+        RenderText {#text} at (0,12) size 48x48
+          text run at (0,12) width 48: "\x{D842}\x{DF9F}"
+      RenderBlock {DIV} at (0,106) size 72x49
+        RenderText {#text} at (12,0) size 48x49
+          text run at (12,0) width 49: "\x{D842}\x{DF9F}"

Modified: trunk/Source/WebCore/ChangeLog (121644 => 121645)


--- trunk/Source/WebCore/ChangeLog	2012-07-02 00:08:17 UTC (rev 121644)
+++ trunk/Source/WebCore/ChangeLog	2012-07-02 00:08:47 UTC (rev 121645)
@@ -1,3 +1,18 @@
+2012-07-01  Dan Bernstein  <[email protected]>
+
+        <rdar://problem/11785743> [mac] Non-BMP characters in vertical text appear as missing glyphs
+        https://bugs.webkit.org/show_bug.cgi?id=90349
+
+        Reviewed by Dean Jackson.
+
+        Test: platform/mac/fast/text/vertical-surrogate-pair.html
+
+        * platform/graphics/mac/GlyphPageTreeNodeMac.cpp:
+        (WebCore::GlyphPage::fill): When calling wkGetVerticalGlyphsForCharacters or
+        CTFontGetGlyphsForCharacters with a buffer consisting of surrogate pair, account for those
+        functions’ behavior of placing glyphs at indices corresponding to the first character of
+        each pair.
+
 2012-07-01  Kenichi Ishibashi  <[email protected]>
 
         Arabic shaping is incorrect if ZWNJ exist

Modified: trunk/Source/WebCore/platform/graphics/mac/GlyphPageTreeNodeMac.cpp (121644 => 121645)


--- trunk/Source/WebCore/platform/graphics/mac/GlyphPageTreeNodeMac.cpp	2012-07-02 00:08:17 UTC (rev 121644)
+++ trunk/Source/WebCore/platform/graphics/mac/GlyphPageTreeNodeMac.cpp	2012-07-02 00:08:47 UTC (rev 121645)
@@ -68,11 +68,14 @@
         }
     } else if (!fontData->platformData().isCompositeFontReference() && ((fontData->platformData().widthVariant() == RegularWidth) ? wkGetVerticalGlyphsForCharacters(fontData->platformData().ctFont(), buffer, glyphs.data(), bufferLength)
                : CTFontGetGlyphsForCharacters(fontData->platformData().ctFont(), buffer, glyphs.data(), bufferLength))) {
+        // When buffer consists of surrogate pairs, wkGetVerticalGlyphsForCharacters and CTFontGetGlyphsForCharacters
+        // place the glyphs at indices corresponding to the first character of each pair.
+        unsigned glyphStep = bufferLength / length;
         for (unsigned i = 0; i < length; ++i) {
-            if (!glyphs[i])
+            if (!glyphs[i * glyphStep])
                 setGlyphDataForIndex(offset + i, 0, 0);
             else {
-                setGlyphDataForIndex(offset + i, glyphs[i], fontData);
+                setGlyphDataForIndex(offset + i, glyphs[i * glyphStep], fontData);
                 haveGlyphs = true;
             }
         }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to