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

Side by Side Diff: third_party/harfbuzz-ng/src/hb-ot-shape-complex-sea.cc

Issue 396393005: Roll HarfBuzz to 0.9.32 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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
OLDNEW
1 /* 1 /*
2 * Copyright © 2011,2012,2013 Google, Inc. 2 * Copyright © 2011,2012,2013 Google, Inc.
3 * 3 *
4 * This is part of HarfBuzz, a text shaping library. 4 * This is part of HarfBuzz, a text shaping library.
5 * 5 *
6 * Permission is hereby granted, without written agreement and without 6 * Permission is hereby granted, without written agreement and without
7 * license or royalty fees, to use, copy, modify, and distribute this 7 * license or royalty fees, to use, copy, modify, and distribute this
8 * software and its documentation for any purpose, provided that the 8 * software and its documentation for any purpose, provided that the
9 * above copyright notice and the following two paragraphs appear in 9 * above copyright notice and the following two paragraphs appear in
10 * all copies of this software. 10 * all copies of this software.
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 OT_VPst = 29, 132 OT_VPst = 29,
133 OT_T = 3, /* Tone Marks */ 133 OT_T = 3, /* Tone Marks */
134 // OT_A = 10, /* Anusvara */ 134 // OT_A = 10, /* Anusvara */
135 }; 135 };
136 136
137 static inline void 137 static inline void
138 set_sea_properties (hb_glyph_info_t &info) 138 set_sea_properties (hb_glyph_info_t &info)
139 { 139 {
140 hb_codepoint_t u = info.codepoint; 140 hb_codepoint_t u = info.codepoint;
141 unsigned int type = hb_indic_get_categories (u); 141 unsigned int type = hb_indic_get_categories (u);
142 indic_category_t cat = (indic_category_t) (type & 0x7F); 142 indic_category_t cat = (indic_category_t) (type & 0x7Fu);
143 indic_position_t pos = (indic_position_t) (type >> 8); 143 indic_position_t pos = (indic_position_t) (type >> 8);
144 144
145 /* Medial Ra */ 145 /* Medial Ra */
146 if (u == 0x1A55 || u == 0xAA34) 146 if (u == 0x1A55u || u == 0xAA34u)
147 cat = (indic_category_t) OT_MR; 147 cat = (indic_category_t) OT_MR;
148 148
149 if (cat == OT_M) 149 if (cat == OT_M)
150 { 150 {
151 switch ((int) pos) 151 switch ((int) pos)
152 { 152 {
153 case POS_PRE_C: cat = (indic_category_t) OT_VPre; break; 153 case POS_PRE_C: cat = (indic_category_t) OT_VPre; break;
154 case POS_ABOVE_C: cat = (indic_category_t) OT_VAbv; break; 154 case POS_ABOVE_C: cat = (indic_category_t) OT_VAbv; break;
155 case POS_BELOW_C: cat = (indic_category_t) OT_VBlw; break; 155 case POS_BELOW_C: cat = (indic_category_t) OT_VBlw; break;
156 case POS_POST_C: cat = (indic_category_t) OT_VPst; break; 156 case POS_POST_C: cat = (indic_category_t) OT_VPst; break;
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 for (unsigned int i = 0; i < count; i++) 281 for (unsigned int i = 0; i < count; i++)
282 if ((buffer->info[i].syllable() & 0x0F) == broken_cluster) { 282 if ((buffer->info[i].syllable() & 0x0F) == broken_cluster) {
283 has_broken_syllables = true; 283 has_broken_syllables = true;
284 break; 284 break;
285 } 285 }
286 if (likely (!has_broken_syllables)) 286 if (likely (!has_broken_syllables))
287 return; 287 return;
288 288
289 289
290 hb_codepoint_t dottedcircle_glyph; 290 hb_codepoint_t dottedcircle_glyph;
291 if (!font->get_glyph (0x25CC, 0, &dottedcircle_glyph)) 291 if (!font->get_glyph (0x25CCu, 0, &dottedcircle_glyph))
292 return; 292 return;
293 293
294 hb_glyph_info_t dottedcircle = {0}; 294 hb_glyph_info_t dottedcircle = {0};
295 dottedcircle.codepoint = 0x25CC; 295 dottedcircle.codepoint = 0x25CCu;
296 set_sea_properties (dottedcircle); 296 set_sea_properties (dottedcircle);
297 dottedcircle.codepoint = dottedcircle_glyph; 297 dottedcircle.codepoint = dottedcircle_glyph;
298 298
299 buffer->clear_output (); 299 buffer->clear_output ();
300 300
301 buffer->idx = 0; 301 buffer->idx = 0;
302 unsigned int last_syllable = 0; 302 unsigned int last_syllable = 0;
303 while (buffer->idx < buffer->len) 303 while (buffer->idx < buffer->len)
304 { 304 {
305 unsigned int syllable = buffer->cur().syllable(); 305 unsigned int syllable = buffer->cur().syllable();
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 NULL, /* data_create */ 368 NULL, /* data_create */
369 NULL, /* data_destroy */ 369 NULL, /* data_destroy */
370 NULL, /* preprocess_text */ 370 NULL, /* preprocess_text */
371 HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_DIACRITICS_NO_SHORT_CIRCUIT, 371 HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_DIACRITICS_NO_SHORT_CIRCUIT,
372 NULL, /* decompose */ 372 NULL, /* decompose */
373 NULL, /* compose */ 373 NULL, /* compose */
374 setup_masks_sea, 374 setup_masks_sea,
375 HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE, 375 HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE,
376 false, /* fallback_position */ 376 false, /* fallback_position */
377 }; 377 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698