OLD | NEW |
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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 return 0; | 100 return 0; |
101 } | 101 } |
102 decomposed[ret] = 0; | 102 decomposed[ret] = 0; |
103 return ret; | 103 return ret; |
104 } | 104 } |
105 | 105 |
106 | 106 |
107 unsigned int | 107 unsigned int |
108 modified_combining_class (hb_codepoint_t unicode) | 108 modified_combining_class (hb_codepoint_t unicode) |
109 { | 109 { |
| 110 /* XXX This hack belongs to the Myanmar shaper. */ |
| 111 if (unicode == 0x1037) unicode = 0x103A; |
| 112 |
110 return _hb_modified_combining_class[combining_class (unicode)]; | 113 return _hb_modified_combining_class[combining_class (unicode)]; |
111 } | 114 } |
112 | 115 |
113 inline hb_bool_t | 116 inline hb_bool_t |
114 is_variation_selector (hb_codepoint_t unicode) | 117 is_variation_selector (hb_codepoint_t unicode) |
115 { | 118 { |
116 return unlikely (hb_in_ranges<hb_codepoint_t> (unicode, | 119 return unlikely (hb_in_ranges<hb_codepoint_t> (unicode, |
117 0x180B, 0x180D, /* MONGOLIAN
FREE VARIATION SELECTOR ONE..THREE */ | 120 0x180B, 0x180D, /* MONGOLIAN
FREE VARIATION SELECTOR ONE..THREE */ |
118 0xFE00, 0xFE0F, /* VARIATION
SELECTOR-1..16 */ | 121 0xFE00, 0xFE0F, /* VARIATION
SELECTOR-1..16 */ |
119 0xE0100, 0xE01EF)); /* VARIA
TION SELECTOR-17..256 */ | 122 0xE0100, 0xE01EF)); /* VARIA
TION SELECTOR-17..256 */ |
120 } | 123 } |
121 | 124 |
122 /* Default_Ignorable codepoints: | 125 /* Default_Ignorable codepoints: |
123 * | 126 * |
124 * Note that as of Oct 2012 (Unicode 6.2), U+180E MONGOLIAN VOWEL SEPARATOR | 127 * Note that as of Oct 2012 (Unicode 6.2), U+180E MONGOLIAN VOWEL SEPARATOR |
125 * is NOT Default_Ignorable, but it really behaves in a way that it should | 128 * is NOT Default_Ignorable, but it really behaves in a way that it should |
126 * be. That has been reported to the Unicode Technical Committee for | 129 * be. That has been reported to the Unicode Technical Committee for |
127 * consideration. As such, we include it here, since Uniscribe removes it. | 130 * consideration. As such, we include it here, since Uniscribe removes it. |
128 * | 131 * |
| 132 * Note: While U+115F and U+1160 are Default_Ignorable, we do NOT want to |
| 133 * hide them, as the way Uniscribe has implemented them is with regular |
| 134 * spacing glyphs, and that's the way fonts are made to work. As such, |
| 135 * we make exceptions for those two. |
| 136 * |
129 * Gathered from: | 137 * Gathered from: |
130 * http://unicode.org/cldr/utility/list-unicodeset.jsp?a=[:DI:]&abb=on&ucd=on&
esc=on | 138 * http://unicode.org/cldr/utility/list-unicodeset.jsp?a=[:DI:]&abb=on&ucd=on&
esc=on |
131 * | 139 * |
132 * Last updated to the page with the following versions: | 140 * Last updated to the page with the following versions: |
133 * Version 3.6; ICU version: 50.0.1.0; Unicode version: 6.1.0.0 | 141 * Version 3.6; ICU version: 50.0.1.0; Unicode version: 6.1.0.0 |
134 * | 142 * |
135 * 4,167 Code Points | 143 * 4,167 Code Points |
136 * | 144 * |
137 * [\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] | 145 * [\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] |
138 * | 146 * |
139 * 00AD ;SOFT HYPHEN | 147 * 00AD ;SOFT HYPHEN |
140 * 034F ;COMBINING GRAPHEME JOINER | 148 * 034F ;COMBINING GRAPHEME JOINER |
141 * 115F ;HANGUL CHOSEONG FILLER | 149 * #115F ;HANGUL CHOSEONG FILLER |
142 * 1160 ;HANGUL JUNGSEONG FILLER | 150 * #1160 ;HANGUL JUNGSEONG FILLER |
143 * 17B4 ;KHMER VOWEL INHERENT AQ | 151 * 17B4 ;KHMER VOWEL INHERENT AQ |
144 * 17B5 ;KHMER VOWEL INHERENT AA | 152 * 17B5 ;KHMER VOWEL INHERENT AA |
145 * 180B..180D ;MONGOLIAN FREE VARIATION SELECTOR THREE | 153 * 180B..180D ;MONGOLIAN FREE VARIATION SELECTOR THREE |
146 * 200B..200F ;RIGHT-TO-LEFT MARK | 154 * 200B..200F ;RIGHT-TO-LEFT MARK |
147 * 202A..202E ;RIGHT-TO-LEFT OVERRIDE | 155 * 202A..202E ;RIGHT-TO-LEFT OVERRIDE |
148 * 2060..206F ;NOMINAL DIGIT SHAPES | 156 * 2060..206F ;NOMINAL DIGIT SHAPES |
149 * 3164 ;HANGUL FILLER | 157 * 3164 ;HANGUL FILLER |
150 * FE00..FE0F ;VARIATION SELECTOR-16 | 158 * FE00..FE0F ;VARIATION SELECTOR-16 |
151 * FEFF ;ZERO WIDTH NO-BREAK SPACE | 159 * FEFF ;ZERO WIDTH NO-BREAK SPACE |
152 * FFA0 ;HALFWIDTH HANGUL FILLER | 160 * FFA0 ;HALFWIDTH HANGUL FILLER |
153 * FFF0..FFF8 ;<unassigned-FFF8> | 161 * FFF0..FFF8 ;<unassigned-FFF8> |
154 * 1D173..1D17A ;MUSICAL SYMBOL END PHRASE | 162 * 1D173..1D17A ;MUSICAL SYMBOL END PHRASE |
155 * E0000..E0FFF ;<unassigned-E0FFF> | 163 * E0000..E0FFF ;<unassigned-E0FFF> |
156 */ | 164 */ |
157 inline hb_bool_t | 165 inline hb_bool_t |
158 is_default_ignorable (hb_codepoint_t ch) | 166 is_default_ignorable (hb_codepoint_t ch) |
159 { | 167 { |
160 hb_codepoint_t plane = ch >> 16; | 168 hb_codepoint_t plane = ch >> 16; |
161 if (likely (plane == 0)) | 169 if (likely (plane == 0)) |
162 { | 170 { |
163 /* BMP */ | 171 /* BMP */ |
164 hb_codepoint_t page = ch >> 8; | 172 hb_codepoint_t page = ch >> 8; |
165 switch (page) { | 173 switch (page) { |
166 case 0x00: return unlikely (ch == 0x00AD); | 174 case 0x00: return unlikely (ch == 0x00AD); |
167 case 0x03: return unlikely (ch == 0x034F); | 175 case 0x03: return unlikely (ch == 0x034F); |
168 case 0x11: return hb_in_range<hb_codepoint_t> (ch, 0x115F, 0x1160); | |
169 case 0x17: return hb_in_range<hb_codepoint_t> (ch, 0x17B4, 0x17B5); | 176 case 0x17: return hb_in_range<hb_codepoint_t> (ch, 0x17B4, 0x17B5); |
170 case 0x18: return hb_in_range<hb_codepoint_t> (ch, 0x180B, 0x180E); | 177 case 0x18: return hb_in_range<hb_codepoint_t> (ch, 0x180B, 0x180E); |
171 case 0x20: return hb_in_ranges<hb_codepoint_t> (ch, 0x200B, 0x200F, | 178 case 0x20: return hb_in_ranges<hb_codepoint_t> (ch, 0x200B, 0x200F, |
172 0x202A, 0x202E, | 179 0x202A, 0x202E, |
173 0x2060, 0x206F); | 180 0x2060, 0x206F); |
174 case 0x31: return unlikely (ch == 0x3164); | 181 case 0x31: return unlikely (ch == 0x3164); |
175 case 0xFE: return hb_in_range<hb_codepoint_t> (ch, 0xFE00, 0xFE0F) || ch
== 0xFEFF; | 182 case 0xFE: return hb_in_range<hb_codepoint_t> (ch, 0xFE00, 0xFE0F) || ch
== 0xFEFF; |
176 case 0xFF: return hb_in_range<hb_codepoint_t> (ch, 0xFFF0, 0xFFF8) || ch
== 0xFFA0; | 183 case 0xFF: return hb_in_range<hb_codepoint_t> (ch, 0xFFF0, 0xFFF8) || ch
== 0xFFA0; |
177 default: return false; | 184 default: return false; |
178 } | 185 } |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 /* Misc */ | 304 /* Misc */ |
298 | 305 |
299 #define HB_UNICODE_GENERAL_CATEGORY_IS_MARK(gen_cat) \ | 306 #define HB_UNICODE_GENERAL_CATEGORY_IS_MARK(gen_cat) \ |
300 (FLAG (gen_cat) & \ | 307 (FLAG (gen_cat) & \ |
301 (FLAG (HB_UNICODE_GENERAL_CATEGORY_SPACING_MARK) | \ | 308 (FLAG (HB_UNICODE_GENERAL_CATEGORY_SPACING_MARK) | \ |
302 FLAG (HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK) | \ | 309 FLAG (HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK) | \ |
303 FLAG (HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK))) | 310 FLAG (HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK))) |
304 | 311 |
305 | 312 |
306 #endif /* HB_UNICODE_PRIVATE_HH */ | 313 #endif /* HB_UNICODE_PRIVATE_HH */ |
OLD | NEW |