| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright © 2013 Google, Inc. | 2 * Copyright © 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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 * - <LV,T> we should compose if the whole thing can be composed, otherwise we
should | 181 * - <LV,T> we should compose if the whole thing can be composed, otherwise we
should |
| 182 * decompose. | 182 * decompose. |
| 183 */ | 183 */ |
| 184 | 184 |
| 185 buffer->clear_output (); | 185 buffer->clear_output (); |
| 186 unsigned int start = 0, end = 0; /* Extent of most recently seen syllable; | 186 unsigned int start = 0, end = 0; /* Extent of most recently seen syllable; |
| 187 * valid only if start < end | 187 * valid only if start < end |
| 188 */ | 188 */ |
| 189 unsigned int count = buffer->len; | 189 unsigned int count = buffer->len; |
| 190 | 190 |
| 191 for (buffer->idx = 0; buffer->idx < count;) | 191 for (buffer->idx = 0; buffer->idx < count && !buffer->in_error;) |
| 192 { | 192 { |
| 193 hb_codepoint_t u = buffer->cur().codepoint; | 193 hb_codepoint_t u = buffer->cur().codepoint; |
| 194 | 194 |
| 195 if (isHangulTone (u)) | 195 if (isHangulTone (u)) |
| 196 { | 196 { |
| 197 /* | 197 /* |
| 198 * We could cache the width of the tone marks and the existence of dotted-
circle, | 198 * We could cache the width of the tone marks and the existence of dotted-
circle, |
| 199 * but the use of the Hangul tone mark characters seems to be rare enough
that | 199 * but the use of the Hangul tone mark characters seems to be rare enough
that |
| 200 * I didn't bother for now. | 200 * I didn't bother for now. |
| 201 */ | 201 */ |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 | 404 |
| 405 HB_BUFFER_DEALLOCATE_VAR (buffer, hangul_shaping_feature); | 405 HB_BUFFER_DEALLOCATE_VAR (buffer, hangul_shaping_feature); |
| 406 } | 406 } |
| 407 | 407 |
| 408 | 408 |
| 409 const hb_ot_complex_shaper_t _hb_ot_complex_shaper_hangul = | 409 const hb_ot_complex_shaper_t _hb_ot_complex_shaper_hangul = |
| 410 { | 410 { |
| 411 "hangul", | 411 "hangul", |
| 412 collect_features_hangul, | 412 collect_features_hangul, |
| 413 override_features_hangul, | 413 override_features_hangul, |
| 414 data_create_hangul, /* data_create */ | 414 data_create_hangul, |
| 415 data_destroy_hangul, /* data_destroy */ | 415 data_destroy_hangul, |
| 416 preprocess_text_hangul, | 416 preprocess_text_hangul, |
| 417 NULL, /* postprocess_glyphs */ |
| 417 HB_OT_SHAPE_NORMALIZATION_MODE_NONE, | 418 HB_OT_SHAPE_NORMALIZATION_MODE_NONE, |
| 418 NULL, /* decompose */ | 419 NULL, /* decompose */ |
| 419 NULL, /* compose */ | 420 NULL, /* compose */ |
| 420 setup_masks_hangul, /* setup_masks */ | 421 setup_masks_hangul, |
| 421 HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE, | 422 HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE, |
| 422 false, /* fallback_position */ | 423 false, /* fallback_position */ |
| 423 }; | 424 }; |
| OLD | NEW |