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

Side by Side Diff: third_party/harfbuzz-ng/src/hb-unicode-private.hh

Issue 205003003: Update harfbuzz-ng to 0.9.27 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: w/missing files Created 6 years, 9 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 | « third_party/harfbuzz-ng/src/hb-unicode.cc ('k') | third_party/harfbuzz-ng/src/hb-uniscribe.cc » ('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 © 2009 Red Hat, Inc. 2 * Copyright © 2009 Red Hat, Inc.
3 * Copyright © 2011 Codethink Limited 3 * Copyright © 2011 Codethink Limited
4 * Copyright © 2010,2011,2012 Google, Inc. 4 * Copyright © 2010,2011,2012 Google, Inc.
5 * 5 *
6 * This is part of HarfBuzz, a text shaping library. 6 * This is part of HarfBuzz, a text shaping library.
7 * 7 *
8 * Permission is hereby granted, without written agreement and without 8 * Permission is hereby granted, without written agreement and without
9 * license or royalty fees, to use, copy, modify, and distribute this 9 * license or royalty fees, to use, copy, modify, and distribute this
10 * software and its documentation for any purpose, provided that the 10 * software and its documentation for any purpose, provided that the
(...skipping 14 matching lines...) Expand all
25 * 25 *
26 * Red Hat Author(s): Behdad Esfahbod 26 * Red Hat Author(s): Behdad Esfahbod
27 * Codethink Author(s): Ryan Lortie 27 * Codethink Author(s): Ryan Lortie
28 * Google Author(s): Behdad Esfahbod 28 * Google Author(s): Behdad Esfahbod
29 */ 29 */
30 30
31 #ifndef HB_UNICODE_PRIVATE_HH 31 #ifndef HB_UNICODE_PRIVATE_HH
32 #define HB_UNICODE_PRIVATE_HH 32 #define HB_UNICODE_PRIVATE_HH
33 33
34 #include "hb-private.hh" 34 #include "hb-private.hh"
35
36 #include "hb-unicode.h"
37 #include "hb-object-private.hh" 35 #include "hb-object-private.hh"
38 36
39 37
40 extern HB_INTERNAL const uint8_t _hb_modified_combining_class[256]; 38 extern HB_INTERNAL const uint8_t _hb_modified_combining_class[256];
41 39
42 /* 40 /*
43 * hb_unicode_funcs_t 41 * hb_unicode_funcs_t
44 */ 42 */
45 43
46 #define HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS \ 44 #define HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS \
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 } 99 }
102 decomposed[ret] = 0; 100 decomposed[ret] = 0;
103 return ret; 101 return ret;
104 } 102 }
105 103
106 104
107 unsigned int 105 unsigned int
108 modified_combining_class (hb_codepoint_t unicode) 106 modified_combining_class (hb_codepoint_t unicode)
109 { 107 {
110 /* XXX This hack belongs to the Myanmar shaper. */ 108 /* XXX This hack belongs to the Myanmar shaper. */
111 if (unicode == 0x1037) unicode = 0x103A; 109 if (unlikely (unicode == 0x1037)) unicode = 0x103A;
110
111 /* XXX This hack belongs to the SEA shaper (for Tai Tham):
112 * Reorder SAKOT to ensure it comes after any tone marks. */
113 if (unlikely (unicode == 0x1A60)) return 254;
112 114
113 return _hb_modified_combining_class[combining_class (unicode)]; 115 return _hb_modified_combining_class[combining_class (unicode)];
114 } 116 }
115 117
116 inline hb_bool_t 118 inline hb_bool_t
117 is_variation_selector (hb_codepoint_t unicode) 119 is_variation_selector (hb_codepoint_t unicode)
118 { 120 {
119 return unlikely (hb_in_ranges<hb_codepoint_t> (unicode, 121 return unlikely (hb_in_ranges<hb_codepoint_t> (unicode,
120 0x180B, 0x180D, /* MONGOLIAN FREE VARIATION SELECTOR ONE..THREE */ 122 0x180B, 0x180D, /* MONGOLIAN FREE VARIATION SELECTOR ONE..THREE */
121 0xFE00, 0xFE0F, /* VARIATION SELECTOR-1..16 */ 123 0xFE00, 0xFE0F, /* VARIATION SELECTOR-1..16 */
122 0xE0100, 0xE01EF)); /* VARIA TION SELECTOR-17..256 */ 124 0xE0100, 0xE01EF)); /* VARIA TION SELECTOR-17..256 */
123 } 125 }
124 126
125 /* Default_Ignorable codepoints: 127 /* Default_Ignorable codepoints:
126 * 128 *
127 * Note that as of Oct 2012 (Unicode 6.2), U+180E MONGOLIAN VOWEL SEPARATOR 129 * Note that as of Oct 2012 (Unicode 6.2), U+180E MONGOLIAN VOWEL SEPARATOR
128 * is NOT Default_Ignorable, but it really behaves in a way that it should 130 * is NOT Default_Ignorable, but it really behaves in a way that it should
129 * be. That has been reported to the Unicode Technical Committee for 131 * be. That has been reported to the Unicode Technical Committee for
130 * consideration. As such, we include it here, since Uniscribe removes it. 132 * consideration. As such, we include it here, since Uniscribe removes it.
131 * It *is* in Unicode 6.3 however. U+061C ARABIC LETTER MARK from Unicode 133 * It *is* in Unicode 6.3 however. U+061C ARABIC LETTER MARK from Unicode
132 * 6.3 is also added manually. The new Unicode 6.3 bidi formatting 134 * 6.3 is also added manually. The new Unicode 6.3 bidi formatting
133 * characters are encoded in a block that was Default_Ignorable already. 135 * characters are encoded in a block that was Default_Ignorable already.
134 * 136 *
135 * Note: While U+115F and U+1160 are Default_Ignorable, we do NOT want to 137 * Note: While U+115F, U+1160, U+3164 and U+FFA0 are Default_Ignorable,
136 * hide them, as the way Uniscribe has implemented them is with regular 138 * we do NOT want to hide them, as the way Uniscribe has implemented them
137 * spacing glyphs, and that's the way fonts are made to work. As such, 139 * is with regular spacing glyphs, and that's the way fonts are made to work.
138 * we make exceptions for those two. 140 * As such, we make exceptions for those four.
139 * 141 *
140 * Gathered from: 142 * Gathered from:
141 * http://unicode.org/cldr/utility/list-unicodeset.jsp?a=[:DI:]&abb=on&ucd=on& esc=on 143 * http://unicode.org/cldr/utility/list-unicodeset.jsp?a=[:DI:]&abb=on&ucd=on& esc=on
142 * 144 *
143 * Last updated to the page with the following versions: 145 * Last updated to the page with the following versions:
144 * Version 3.6; ICU version: 50.0.1.0; Unicode version: 6.1.0.0 146 * Version 3.6; ICU version: 50.0.1.0; Unicode version: 6.1.0.0
145 * 147 *
146 * 4,167 Code Points 148 * 4,167 Code Points
147 * 149 *
148 * [\u00AD\u034F\u115F\u1160\u17B4\u17B5\u180B-\u180D\u200B-\u200F\u202A-\u202 E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8\U0001D173-\U0001D17A\ U000E0000-\U000E0FFF] 150 * [\u00AD\u034F\u115F\u1160\u17B4\u17B5\u180B-\u180D\u200B-\u200F\u202A-\u202 E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8\U0001D173-\U0001D17A\ U000E0000-\U000E0FFF]
149 * 151 *
150 * 00AD ;SOFT HYPHEN 152 * 00AD ;SOFT HYPHEN
151 * 034F ;COMBINING GRAPHEME JOINER 153 * 034F ;COMBINING GRAPHEME JOINER
152 * #115F ;HANGUL CHOSEONG FILLER 154 * #115F ;HANGUL CHOSEONG FILLER
153 * #1160 ;HANGUL JUNGSEONG FILLER 155 * #1160 ;HANGUL JUNGSEONG FILLER
154 * 17B4 ;KHMER VOWEL INHERENT AQ 156 * 17B4 ;KHMER VOWEL INHERENT AQ
155 * 17B5 ;KHMER VOWEL INHERENT AA 157 * 17B5 ;KHMER VOWEL INHERENT AA
156 * 180B..180D ;MONGOLIAN FREE VARIATION SELECTOR THREE 158 * 180B..180D ;MONGOLIAN FREE VARIATION SELECTOR THREE
157 * 200B..200F ;RIGHT-TO-LEFT MARK 159 * 200B..200F ;RIGHT-TO-LEFT MARK
158 * 202A..202E ;RIGHT-TO-LEFT OVERRIDE 160 * 202A..202E ;RIGHT-TO-LEFT OVERRIDE
159 * 2060..206F ;NOMINAL DIGIT SHAPES 161 * 2060..206F ;NOMINAL DIGIT SHAPES
160 * 3164 ;HANGUL FILLER 162 * #3164 ;HANGUL FILLER
161 * FE00..FE0F ;VARIATION SELECTOR-16 163 * FE00..FE0F ;VARIATION SELECTOR-16
162 * FEFF ;ZERO WIDTH NO-BREAK SPACE 164 * FEFF ;ZERO WIDTH NO-BREAK SPACE
163 * FFA0 ;HALFWIDTH HANGUL FILLER 165 * #FFA0 ;HALFWIDTH HANGUL FILLER
164 * FFF0..FFF8 ;<unassigned-FFF8> 166 * FFF0..FFF8 ;<unassigned-FFF8>
165 * 1D173..1D17A ;MUSICAL SYMBOL END PHRASE 167 * 1D173..1D17A ;MUSICAL SYMBOL END PHRASE
166 * E0000..E0FFF ;<unassigned-E0FFF> 168 * E0000..E0FFF ;<unassigned-E0FFF>
167 */ 169 */
168 inline hb_bool_t 170 inline hb_bool_t
169 is_default_ignorable (hb_codepoint_t ch) 171 is_default_ignorable (hb_codepoint_t ch)
170 { 172 {
171 hb_codepoint_t plane = ch >> 16; 173 hb_codepoint_t plane = ch >> 16;
172 if (likely (plane == 0)) 174 if (likely (plane == 0))
173 { 175 {
174 /* BMP */ 176 /* BMP */
175 hb_codepoint_t page = ch >> 8; 177 hb_codepoint_t page = ch >> 8;
176 switch (page) { 178 switch (page) {
177 case 0x00: return unlikely (ch == 0x00AD); 179 case 0x00: return unlikely (ch == 0x00AD);
178 case 0x03: return unlikely (ch == 0x034F); 180 case 0x03: return unlikely (ch == 0x034F);
179 case 0x06: return unlikely (ch == 0x061C); 181 case 0x06: return unlikely (ch == 0x061C);
180 case 0x17: return hb_in_range<hb_codepoint_t> (ch, 0x17B4, 0x17B5); 182 case 0x17: return hb_in_range<hb_codepoint_t> (ch, 0x17B4, 0x17B5);
181 case 0x18: return hb_in_range<hb_codepoint_t> (ch, 0x180B, 0x180E); 183 case 0x18: return hb_in_range<hb_codepoint_t> (ch, 0x180B, 0x180E);
182 case 0x20: return hb_in_ranges<hb_codepoint_t> (ch, 0x200B, 0x200F, 184 case 0x20: return hb_in_ranges<hb_codepoint_t> (ch, 0x200B, 0x200F,
183 0x202A, 0x202E, 185 0x202A, 0x202E,
184 0x2060, 0x206F); 186 0x2060, 0x206F);
185 case 0x31: return unlikely (ch == 0x3164);
186 case 0xFE: return hb_in_range<hb_codepoint_t> (ch, 0xFE00, 0xFE0F) || ch == 0xFEFF; 187 case 0xFE: return hb_in_range<hb_codepoint_t> (ch, 0xFE00, 0xFE0F) || ch == 0xFEFF;
187 » case 0xFF: return hb_in_range<hb_codepoint_t> (ch, 0xFFF0, 0xFFF8) || ch == 0xFFA0; 188 » case 0xFF: return hb_in_range<hb_codepoint_t> (ch, 0xFFF0, 0xFFF8);
188 default: return false; 189 default: return false;
189 } 190 }
190 } 191 }
191 else 192 else
192 { 193 {
193 /* Other planes */ 194 /* Other planes */
194 switch (plane) { 195 switch (plane) {
195 case 0x01: return hb_in_range<hb_codepoint_t> (ch, 0x0001D173, 0x0001D17 A); 196 case 0x01: return hb_in_range<hb_codepoint_t> (ch, 0x0001D173, 0x0001D17 A);
196 case 0x0E: return hb_in_range<hb_codepoint_t> (ch, 0x000E0000, 0x000E0FF F); 197 case 0x0E: return hb_in_range<hb_codepoint_t> (ch, 0x000E0000, 0x000E0FF F);
197 default: return false; 198 default: return false;
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 /* Misc */ 309 /* Misc */
309 310
310 #define HB_UNICODE_GENERAL_CATEGORY_IS_MARK(gen_cat) \ 311 #define HB_UNICODE_GENERAL_CATEGORY_IS_MARK(gen_cat) \
311 (FLAG (gen_cat) & \ 312 (FLAG (gen_cat) & \
312 (FLAG (HB_UNICODE_GENERAL_CATEGORY_SPACING_MARK) | \ 313 (FLAG (HB_UNICODE_GENERAL_CATEGORY_SPACING_MARK) | \
313 FLAG (HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK) | \ 314 FLAG (HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK) | \
314 FLAG (HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK))) 315 FLAG (HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK)))
315 316
316 317
317 #endif /* HB_UNICODE_PRIVATE_HH */ 318 #endif /* HB_UNICODE_PRIVATE_HH */
OLDNEW
« no previous file with comments | « third_party/harfbuzz-ng/src/hb-unicode.cc ('k') | third_party/harfbuzz-ng/src/hb-uniscribe.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698