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.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@121645
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-07-01 Dan Bernstein <mitz@apple.com>
+
+ <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 <bashi@chromium.org>
Arabic shaping is incorrect if ZWNJ exist
--- /dev/null
+<style>
+ div { font-family: 'hiragino mincho pro'; font-size: 48px; }
+</style>
+<p>
+ These two glyphs should look the same:
+</p>
+<div>𠮟</div>
+<div style="-webkit-writing-mode: vertical-lr;">𠮟</div>
--- /dev/null
+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}"
+2012-07-01 Dan Bernstein <mitz@apple.com>
+
+ <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 <bashi@chromium.org>
Arabic shaping is incorrect if ZWNJ exist
}
} 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;
}
}