Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |