OLD | NEW |
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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 for (i = 0; i < len; i++) | 190 for (i = 0; i < len; i++) |
191 output_char (c->buffer, decomposed[i], glyphs[i]); | 191 output_char (c->buffer, decomposed[i], glyphs[i]); |
192 | 192 |
193 return len; | 193 return len; |
194 } | 194 } |
195 | 195 |
196 static inline void | 196 static inline void |
197 decompose_current_character (const hb_ot_shape_normalize_context_t *c, bool shor
test) | 197 decompose_current_character (const hb_ot_shape_normalize_context_t *c, bool shor
test) |
198 { | 198 { |
199 hb_buffer_t * const buffer = c->buffer; | 199 hb_buffer_t * const buffer = c->buffer; |
| 200 hb_codepoint_t u = buffer->cur().codepoint; |
200 hb_codepoint_t glyph; | 201 hb_codepoint_t glyph; |
201 | 202 |
202 /* Kind of a cute waterfall here... */ | 203 /* Kind of a cute waterfall here... */ |
203 if (shortest && c->font->get_glyph (buffer->cur().codepoint, 0, &glyph)) | 204 if (shortest && c->font->get_glyph (u, 0, &glyph)) |
204 next_char (buffer, glyph); | 205 next_char (buffer, glyph); |
205 else if (decompose (c, shortest, buffer->cur().codepoint)) | 206 else if (decompose (c, shortest, u)) |
206 skip_char (buffer); | 207 skip_char (buffer); |
207 else if (!shortest && c->font->get_glyph (buffer->cur().codepoint, 0, &glyph)) | 208 else if (!shortest && c->font->get_glyph (u, 0, &glyph)) |
208 next_char (buffer, glyph); | 209 next_char (buffer, glyph); |
209 else if (decompose_compatibility (c, buffer->cur().codepoint)) | 210 else if (decompose_compatibility (c, u)) |
210 skip_char (buffer); | 211 skip_char (buffer); |
211 else | 212 else |
212 next_char (buffer, glyph); /* glyph is initialized in earlier branches. */ | 213 next_char (buffer, glyph); /* glyph is initialized in earlier branches. */ |
213 } | 214 } |
214 | 215 |
215 static inline void | 216 static inline void |
216 handle_variation_selector_cluster (const hb_ot_shape_normalize_context_t *c, uns
igned int end, bool short_circuit) | 217 handle_variation_selector_cluster (const hb_ot_shape_normalize_context_t *c, uns
igned int end, bool short_circuit) |
217 { | 218 { |
218 /* TODO Currently if there's a variation-selector we give-up, it's just too ha
rd. */ | 219 /* 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; | 220 hb_buffer_t * const buffer = c->buffer; |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 | 407 |
407 /* Blocked, or doesn't compose. */ | 408 /* Blocked, or doesn't compose. */ |
408 buffer->next_glyph (); | 409 buffer->next_glyph (); |
409 | 410 |
410 if (_hb_glyph_info_get_modified_combining_class (&buffer->prev()) == 0) | 411 if (_hb_glyph_info_get_modified_combining_class (&buffer->prev()) == 0) |
411 starter = buffer->out_len - 1; | 412 starter = buffer->out_len - 1; |
412 } | 413 } |
413 buffer->swap_buffers (); | 414 buffer->swap_buffers (); |
414 | 415 |
415 } | 416 } |
OLD | NEW |