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

Side by Side Diff: Source/platform/fonts/Character.h

Issue 1144033004: Unicode Variation Selectors support in collectCandidateRuns (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Avoid using wcslen() in tests Created 5 years, 6 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
« no previous file with comments | « no previous file | Source/platform/fonts/shaping/HarfBuzzShaper.cpp » ('j') | 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) 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
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
54 static bool isCJKIdeograph(UChar32); 62 static bool isCJKIdeograph(UChar32);
55 static bool isCJKIdeographOrSymbol(UChar32); 63 static bool isCJKIdeographOrSymbol(UChar32);
56 64
57 static unsigned expansionOpportunityCount(const LChar*, size_t length, TextD irection, bool& isAfterExpansion, const TextJustify); 65 static unsigned expansionOpportunityCount(const LChar*, size_t length, TextD irection, bool& isAfterExpansion, const TextJustify);
58 static unsigned expansionOpportunityCount(const UChar*, size_t length, TextD irection, bool& isAfterExpansion, const TextJustify); 66 static unsigned expansionOpportunityCount(const UChar*, size_t length, TextD irection, bool& isAfterExpansion, const TextJustify);
59 67
60 static bool shouldIgnoreRotation(UChar32 character); 68 static bool shouldIgnoreRotation(UChar32 character);
61 69
62 static bool treatAsSpace(UChar c) 70 static bool treatAsSpace(UChar c)
63 { 71 {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 static String normalizeSpaces(const LChar*, unsigned length); 118 static String normalizeSpaces(const LChar*, unsigned length);
111 static String normalizeSpaces(const UChar*, unsigned length); 119 static String normalizeSpaces(const UChar*, unsigned length);
112 120
113 private: 121 private:
114 Character(); 122 Character();
115 }; 123 };
116 124
117 } // namespace blink 125 } // namespace blink
118 126
119 #endif 127 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/platform/fonts/shaping/HarfBuzzShaper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698