Chromium for Mac cannot print surrogate pair in vertical writing mode

CoreText doesn't have vertical glyphs of surrogate pair characters, and
we draw broken glyphs. On Safari, wkGetVerticalGlyphsForCharacters
returns true, and we use the glyphs which is returned from the
SPI. However, according to the description of r149659,
WKGetVerticalGlyphsForCharacters() just returns false on
Chromium. Therefore, we cannot get vertical glyphs from Mac API/SPI.

To work around that, we should not use CoreText for surrogate pair
characters in vertical writing mode, but this always returns horizontal
glyphs.

BUG=337080

Review URL: https://codereview.chromium.org/145473002

git-svn-id: svn://svn.chromium.org/blink/trunk@166358 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent eee4a797
...@@ -494,6 +494,8 @@ crbug.com/254332 [ XP ] fast/forms/submit/submit-focus-by-mouse.html [ ImageOnly ...@@ -494,6 +494,8 @@ crbug.com/254332 [ XP ] fast/forms/submit/submit-focus-by-mouse.html [ ImageOnly
crbug.com/256506 [ Win7 Debug ] crypto/worker-random-values-limits.html [ Pass Crash ] crbug.com/256506 [ Win7 Debug ] crypto/worker-random-values-limits.html [ Pass Crash ]
crbug.com/337080 [ Mac Win Linux ] fast/text/vertical-surrogate-pair.html [ NeedsRebaseline ]
crbug.com/244266 virtual/threaded/animations/animation-controller-drt-api.html [ Failure Pass ] crbug.com/244266 virtual/threaded/animations/animation-controller-drt-api.html [ Failure Pass ]
crbug.com/265650 [ SnowLeopard Debug ] compositing/repaint/transform-style-change.html [ Pass ImageOnlyFailure ] crbug.com/265650 [ SnowLeopard Debug ] compositing/repaint/transform-style-change.html [ Pass ImageOnlyFailure ]
......
<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>
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 72x48
RenderText {#text} at (12,0) size 48x48
text run at (12,0) width 48: "\x{D842}\x{DF9F}"
...@@ -46,6 +46,16 @@ static bool shouldUseCoreText(UChar* buffer, unsigned bufferLength, const Simple ...@@ -46,6 +46,16 @@ static bool shouldUseCoreText(UChar* buffer, unsigned bufferLength, const Simple
{ {
if (fontData->platformData().isCompositeFontReference()) if (fontData->platformData().isCompositeFontReference())
return true; return true;
// CoreText doesn't have vertical glyphs of surrogate pair characters.
// Therefore, we should not use CoreText, but this always returns horizontal glyphs.
// FIXME: We should use vertical glyphs. https://code.google.com/p/chromium/issues/detail?id=340173
if (bufferLength >= 2 && U_IS_SURROGATE(buffer[0]) && fontData->hasVerticalGlyphs()) {
ASSERT(U_IS_SURROGATE_LEAD(buffer[0]));
ASSERT(U_IS_TRAIL(buffer[1]));
return false;
}
if (fontData->platformData().widthVariant() != RegularWidth || fontData->hasVerticalGlyphs()) { if (fontData->platformData().widthVariant() != RegularWidth || fontData->hasVerticalGlyphs()) {
// Ideographs don't have a vertical variant or width variants. // Ideographs don't have a vertical variant or width variants.
for (unsigned i = 0; i < bufferLength; ++i) { for (unsigned i = 0; i < bufferLength; ++i) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment