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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 class PLATFORM_EXPORT Character { | 44 class PLATFORM_EXPORT Character { |
45 public: | 45 public: |
46 static CodePath characterRangeCodePath(const LChar*, unsigned) { return Simp
lePath; } | 46 static CodePath characterRangeCodePath(const LChar*, unsigned) { return Simp
lePath; } |
47 static CodePath characterRangeCodePath(const UChar*, unsigned len); | 47 static CodePath characterRangeCodePath(const UChar*, unsigned len); |
48 | 48 |
49 static inline bool isInRange(UChar32 character, UChar32 lowerBound, UChar32
upperBound) | 49 static inline bool isInRange(UChar32 character, UChar32 lowerBound, UChar32
upperBound) |
50 { | 50 { |
51 return character >= lowerBound && character <= upperBound; | 51 return character >= lowerBound && character <= upperBound; |
52 } | 52 } |
53 | 53 |
54 static inline bool isUnicodeVariationSelector(UChar32 character) | |
55 { | |
56 // http://www.unicode.org/Public/UCD/latest/ucd/StandardizedVariants.htm
l | |
57 return isInRange(character, 0x180B, 0x180D) // MONGOLIAN FREE VARIATION
SELECTOR ONE to THREE | |
58 || isInRange(character, 0xFE00, 0xFE0F) // VARIATION SELECTOR-1 to 1
6 | |
59 || isInRange(character, 0xE0100, 0xE01EF); // VARIATION SELECTOR-17
to 256 | |
60 } | |
61 | |
62 static bool isCJKIdeograph(UChar32); | 54 static bool isCJKIdeograph(UChar32); |
63 static bool isCJKIdeographOrSymbol(UChar32); | 55 static bool isCJKIdeographOrSymbol(UChar32); |
64 | 56 |
65 static unsigned expansionOpportunityCount(const LChar*, size_t length, TextD
irection, bool& isAfterExpansion, const TextJustify); | 57 static unsigned expansionOpportunityCount(const LChar*, size_t length, TextD
irection, bool& isAfterExpansion, const TextJustify); |
66 static unsigned expansionOpportunityCount(const UChar*, size_t length, TextD
irection, bool& isAfterExpansion, const TextJustify); | 58 static unsigned expansionOpportunityCount(const UChar*, size_t length, TextD
irection, bool& isAfterExpansion, const TextJustify); |
67 | 59 |
68 static bool shouldIgnoreRotation(UChar32 character); | 60 static bool shouldIgnoreRotation(UChar32 character); |
69 | 61 |
70 static bool treatAsSpace(UChar c) | 62 static bool treatAsSpace(UChar c) |
71 { | 63 { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 static String normalizeSpaces(const LChar*, unsigned length); | 110 static String normalizeSpaces(const LChar*, unsigned length); |
119 static String normalizeSpaces(const UChar*, unsigned length); | 111 static String normalizeSpaces(const UChar*, unsigned length); |
120 | 112 |
121 private: | 113 private: |
122 Character(); | 114 Character(); |
123 }; | 115 }; |
124 | 116 |
125 } // namespace blink | 117 } // namespace blink |
126 | 118 |
127 #endif | 119 #endif |
OLD | NEW |