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

Side by Side Diff: third_party/harfbuzz-ng/src/hb-ot-shape-normalize.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 Google, Inc. 2 * Copyright © 2011,2012 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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 /* Kind of a cute waterfall here... */ 202 /* Kind of a cute waterfall here... */
203 if (shortest && c->font->get_glyph (buffer->cur().codepoint, 0, &glyph)) 203 if (shortest && c->font->get_glyph (buffer->cur().codepoint, 0, &glyph))
204 next_char (buffer, glyph); 204 next_char (buffer, glyph);
205 else if (decompose (c, shortest, buffer->cur().codepoint)) 205 else if (decompose (c, shortest, buffer->cur().codepoint))
206 skip_char (buffer); 206 skip_char (buffer);
207 else if (!shortest && c->font->get_glyph (buffer->cur().codepoint, 0, &glyph)) 207 else if (!shortest && c->font->get_glyph (buffer->cur().codepoint, 0, &glyph))
208 next_char (buffer, glyph); 208 next_char (buffer, glyph);
209 else if (decompose_compatibility (c, buffer->cur().codepoint)) 209 else if (decompose_compatibility (c, buffer->cur().codepoint))
210 skip_char (buffer); 210 skip_char (buffer);
211 else 211 else
212 {
213 /* Not found, not decomposible; If codepoint is invalid Unicode and
214 * font supports U+FFFD REPLACEMENT CHARACTER, use that instead. */
215 hb_codepoint_t FFFD_glyph;
216 if (buffer->cur().codepoint > 0x10FFFFu && c->font->get_glyph (0xFFFDu, 0, & FFFD_glyph))
217 glyph = FFFD_glyph;
212 next_char (buffer, glyph); /* glyph is initialized in earlier branches. */ 218 next_char (buffer, glyph); /* glyph is initialized in earlier branches. */
219 }
213 } 220 }
214 221
215 static inline void 222 static inline void
216 handle_variation_selector_cluster (const hb_ot_shape_normalize_context_t *c, uns igned int end, bool short_circuit) 223 handle_variation_selector_cluster (const hb_ot_shape_normalize_context_t *c, uns igned int end, bool short_circuit)
217 { 224 {
218 /* TODO Currently if there's a variation-selector we give-up, it's just too ha rd. */ 225 /* TODO Currently if there's a variation-selector we give-up, it's just too ha rd. */
219 hb_buffer_t * const buffer = c->buffer; 226 hb_buffer_t * const buffer = c->buffer;
220 hb_font_t * const font = c->font; 227 hb_font_t * const font = c->font;
221 for (; buffer->idx < end - 1;) { 228 for (; buffer->idx < end - 1;) {
222 if (unlikely (buffer->unicode->is_variation_selector (buffer->cur(+1).codepo int))) { 229 if (unlikely (buffer->unicode->is_variation_selector (buffer->cur(+1).codepo int))) {
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 411
405 /* Blocked, or doesn't compose. */ 412 /* Blocked, or doesn't compose. */
406 buffer->next_glyph (); 413 buffer->next_glyph ();
407 414
408 if (_hb_glyph_info_get_modified_combining_class (&buffer->prev()) == 0) 415 if (_hb_glyph_info_get_modified_combining_class (&buffer->prev()) == 0)
409 starter = buffer->out_len - 1; 416 starter = buffer->out_len - 1;
410 } 417 }
411 buffer->swap_buffers (); 418 buffer->swap_buffers ();
412 419
413 } 420 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698