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

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: Added NeedsRebaseline 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 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 27 matching lines...) Expand all
38 extern "C" { 38 extern "C" {
39 void CGFontGetGlyphsForUnichars(CGFontRef font, const UniChar chars[], CGGlyph g lyphs[], size_t length); 39 void CGFontGetGlyphsForUnichars(CGFontRef font, const UniChar chars[], CGGlyph g lyphs[], size_t length);
40 } 40 }
41 41
42 namespace WebCore { 42 namespace WebCore {
43 43
44 static bool shouldUseCoreText(UChar* buffer, unsigned bufferLength, const Simple FontData* fontData) 44 static bool shouldUseCoreText(UChar* buffer, unsigned bufferLength, const Simple FontData* fontData)
45 { 45 {
46 if (fontData->platformData().isCompositeFontReference()) 46 if (fontData->platformData().isCompositeFontReference())
47 return true; 47 return true;
48
49 // CoreText doesn't have vertical glyphs of surrogate pair characters, and w e draw broken glyphs.
leviw_travelin_and_unemployed 2014/01/28 19:16:40 If I understand this patch, your change is to make
50 // To work around that, we should not use CoreText, but this always returns horizontal glyphs.
51 // FIXME: We should use vertical glyphs.
leviw_travelin_and_unemployed 2014/01/28 19:16:40 Please add a reference to a bug number.
52 if (bufferLength >= 2 && U_IS_SURROGATE(buffer[0]) && fontData->hasVerticalG lyphs()) {
53 ASSERT(U_IS_SURROGATE_LEAD(buffer[0]));
54 ASSERT(U_IS_TRAIL(buffer[1]));
55 return false;
56 }
57
48 if (fontData->platformData().widthVariant() != RegularWidth || fontData->has VerticalGlyphs()) { 58 if (fontData->platformData().widthVariant() != RegularWidth || fontData->has VerticalGlyphs()) {
49 // Ideographs don't have a vertical variant or width variants. 59 // Ideographs don't have a vertical variant or width variants.
50 for (unsigned i = 0; i < bufferLength; ++i) { 60 for (unsigned i = 0; i < bufferLength; ++i) {
51 if (!Font::isCJKIdeograph(buffer[i])) 61 if (!Font::isCJKIdeograph(buffer[i]))
52 return true; 62 return true;
53 } 63 }
54 } 64 }
55 65
56 return false; 66 return false;
57 } 67 }
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 } 169 }
160 } 170 }
161 } 171 }
162 } 172 }
163 } 173 }
164 174
165 return haveGlyphs; 175 return haveGlyphs;
166 } 176 }
167 177
168 } // namespace WebCore 178 } // 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