Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(190)

Unified Diff: Source/platform/fonts/mac/GlyphPageTreeNodeMac.cpp

Issue 145473002: Chromium for Mac cannot print surrogate pair in vertical writing mode (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Changed comments. Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/platform/mac/fast/text/vertical-surrogate-pair-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/mac/GlyphPageTreeNodeMac.cpp
diff --git a/Source/platform/fonts/mac/GlyphPageTreeNodeMac.cpp b/Source/platform/fonts/mac/GlyphPageTreeNodeMac.cpp
index 2b6dab4e2ca93a875d3b07b476700ab49d731e8a..813a4068e51c9ec024da1b242a94616f115b17f9 100644
--- a/Source/platform/fonts/mac/GlyphPageTreeNodeMac.cpp
+++ b/Source/platform/fonts/mac/GlyphPageTreeNodeMac.cpp
@@ -46,6 +46,16 @@ static bool shouldUseCoreText(UChar* buffer, unsigned bufferLength, const Simple
{
if (fontData->platformData().isCompositeFontReference())
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()) {
// Ideographs don't have a vertical variant or width variants.
for (unsigned i = 0; i < bufferLength; ++i) {
« no previous file with comments | « LayoutTests/platform/mac/fast/text/vertical-surrogate-pair-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698