| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 }; | 123 }; |
| 124 | 124 |
| 125 CodePath result = SimplePath; | 125 CodePath result = SimplePath; |
| 126 for (unsigned i = 0; i < len; i++) { | 126 for (unsigned i = 0; i < len; i++) { |
| 127 const UChar c = characters[i]; | 127 const UChar c = characters[i]; |
| 128 | 128 |
| 129 // Shortcut for common case | 129 // Shortcut for common case |
| 130 if (c < 0x2E5) | 130 if (c < 0x2E5) |
| 131 continue; | 131 continue; |
| 132 | 132 |
| 133 // U+1E00 through U+2000 characters with diacritics and stacked diacriti
cs | |
| 134 if (c >= 0x1E00 && c <= 0x2000) { | |
| 135 result = SimpleWithGlyphOverflowPath; | |
| 136 continue; | |
| 137 } | |
| 138 | |
| 139 // Surrogate pairs | 133 // Surrogate pairs |
| 140 if (c > 0xD7FF && c <= 0xDBFF) { | 134 if (c > 0xD7FF && c <= 0xDBFF) { |
| 141 if (i == len - 1) | 135 if (i == len - 1) |
| 142 continue; | 136 continue; |
| 143 | 137 |
| 144 UChar next = characters[++i]; | 138 UChar next = characters[++i]; |
| 145 if (!U16_IS_TRAIL(next)) | 139 if (!U16_IS_TRAIL(next)) |
| 146 continue; | 140 continue; |
| 147 | 141 |
| 148 UChar32 supplementaryCharacter = U16_GET_SUPPLEMENTARY(c, next); | 142 UChar32 supplementaryCharacter = U16_GET_SUPPLEMENTARY(c, next); |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 { | 444 { |
| 451 return normalizeSpacesInternal(characters, length); | 445 return normalizeSpacesInternal(characters, length); |
| 452 } | 446 } |
| 453 | 447 |
| 454 String Character::normalizeSpaces(const UChar* characters, unsigned length) | 448 String Character::normalizeSpaces(const UChar* characters, unsigned length) |
| 455 { | 449 { |
| 456 return normalizeSpacesInternal(characters, length); | 450 return normalizeSpacesInternal(characters, length); |
| 457 } | 451 } |
| 458 | 452 |
| 459 } // namespace blink | 453 } // namespace blink |
| OLD | NEW |