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

Side by Side 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, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « LayoutTests/platform/mac/fast/text/vertical-surrogate-pair-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 28 matching lines...) Expand all
39 extern "C" { 39 extern "C" {
40 void CGFontGetGlyphsForUnichars(CGFontRef font, const UniChar chars[], CGGlyph g lyphs[], size_t length); 40 void CGFontGetGlyphsForUnichars(CGFontRef font, const UniChar chars[], CGGlyph g lyphs[], size_t length);
41 } 41 }
42 42
43 namespace WebCore { 43 namespace WebCore {
44 44
45 static bool shouldUseCoreText(UChar* buffer, unsigned bufferLength, const Simple FontData* fontData) 45 static bool shouldUseCoreText(UChar* buffer, unsigned bufferLength, const Simple FontData* fontData)
46 { 46 {
47 if (fontData->platformData().isCompositeFontReference()) 47 if (fontData->platformData().isCompositeFontReference())
48 return true; 48 return true;
49
50 // CoreText doesn't have vertical glyphs of surrogate pair characters.
51 // Therefore, we should not use CoreText, but this always returns horizontal glyphs.
52 // FIXME: We should use vertical glyphs. https://code.google.com/p/chromium/ issues/detail?id=340173
53 if (bufferLength >= 2 && U_IS_SURROGATE(buffer[0]) && fontData->hasVerticalG lyphs()) {
54 ASSERT(U_IS_SURROGATE_LEAD(buffer[0]));
55 ASSERT(U_IS_TRAIL(buffer[1]));
56 return false;
57 }
58
49 if (fontData->platformData().widthVariant() != RegularWidth || fontData->has VerticalGlyphs()) { 59 if (fontData->platformData().widthVariant() != RegularWidth || fontData->has VerticalGlyphs()) {
50 // Ideographs don't have a vertical variant or width variants. 60 // Ideographs don't have a vertical variant or width variants.
51 for (unsigned i = 0; i < bufferLength; ++i) { 61 for (unsigned i = 0; i < bufferLength; ++i) {
52 if (!Character::isCJKIdeograph(buffer[i])) 62 if (!Character::isCJKIdeograph(buffer[i]))
53 return true; 63 return true;
54 } 64 }
55 } 65 }
56 66
57 return false; 67 return false;
58 } 68 }
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 } 170 }
161 } 171 }
162 } 172 }
163 } 173 }
164 } 174 }
165 175
166 return haveGlyphs; 176 return haveGlyphs;
167 } 177 }
168 178
169 } // namespace WebCore 179 } // namespace WebCore
OLDNEW
« 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