| 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 16 matching lines...) Expand all Loading... |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef Character_h | 31 #ifndef Character_h |
| 32 #define Character_h | 32 #define Character_h |
| 33 | 33 |
| 34 #include "platform/PlatformExport.h" | 34 #include "platform/PlatformExport.h" |
| 35 #include "platform/text/CharacterProperty.h" | 35 #include "platform/text/CharacterProperty.h" |
| 36 #include "platform/text/TextDirection.h" | 36 #include "platform/text/TextDirection.h" |
| 37 #include "platform/text/TextPath.h" | |
| 38 #include "platform/text/TextRun.h" | 37 #include "platform/text/TextRun.h" |
| 39 #include "wtf/ASCIICType.h" | 38 #include "wtf/ASCIICType.h" |
| 40 #include "wtf/Allocator.h" | 39 #include "wtf/Allocator.h" |
| 41 #include "wtf/HashSet.h" | 40 #include "wtf/HashSet.h" |
| 42 #include "wtf/text/CharacterNames.h" | 41 #include "wtf/text/CharacterNames.h" |
| 43 #include "wtf/text/WTFString.h" | 42 #include "wtf/text/WTFString.h" |
| 44 | 43 |
| 45 namespace blink { | 44 namespace blink { |
| 46 | 45 |
| 47 class PLATFORM_EXPORT Character { | 46 class PLATFORM_EXPORT Character { |
| 48 STATIC_ONLY(Character); | 47 STATIC_ONLY(Character); |
| 49 | 48 |
| 50 public: | 49 public: |
| 51 static CodePath characterRangeCodePath(const LChar*, unsigned) { | |
| 52 return SimplePath; | |
| 53 } | |
| 54 static CodePath characterRangeCodePath(const UChar*, unsigned len); | |
| 55 | |
| 56 static inline bool isInRange(UChar32 character, | 50 static inline bool isInRange(UChar32 character, |
| 57 UChar32 lowerBound, | 51 UChar32 lowerBound, |
| 58 UChar32 upperBound) { | 52 UChar32 upperBound) { |
| 59 return character >= lowerBound && character <= upperBound; | 53 return character >= lowerBound && character <= upperBound; |
| 60 } | 54 } |
| 61 | 55 |
| 62 static inline bool isUnicodeVariationSelector(UChar32 character) { | 56 static inline bool isUnicodeVariationSelector(UChar32 character) { |
| 63 // http://www.unicode.org/Public/UCD/latest/ucd/StandardizedVariants.html | 57 // http://www.unicode.org/Public/UCD/latest/ucd/StandardizedVariants.html |
| 64 return isInRange(character, 0x180B, | 58 return isInRange(character, 0x180B, |
| 65 0x180D) // MONGOLIAN FREE VARIATION SELECTOR ONE to THREE | 59 0x180D) // MONGOLIAN FREE VARIATION SELECTOR ONE to THREE |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 | 167 |
| 174 static String normalizeSpaces(const LChar*, unsigned length); | 168 static String normalizeSpaces(const LChar*, unsigned length); |
| 175 static String normalizeSpaces(const UChar*, unsigned length); | 169 static String normalizeSpaces(const UChar*, unsigned length); |
| 176 | 170 |
| 177 static bool isCommonOrInheritedScript(UChar32); | 171 static bool isCommonOrInheritedScript(UChar32); |
| 178 }; | 172 }; |
| 179 | 173 |
| 180 } // namespace blink | 174 } // namespace blink |
| 181 | 175 |
| 182 #endif | 176 #endif |
| OLD | NEW |