OLD | NEW |
1 /* | 1 /* |
2 * Copyright © 2009,2010 Red Hat, Inc. | 2 * Copyright © 2009,2010 Red Hat, Inc. |
3 * Copyright © 2010,2011,2012 Google, Inc. | 3 * Copyright © 2010,2011,2012 Google, Inc. |
4 * | 4 * |
5 * This is part of HarfBuzz, a text shaping library. | 5 * This is part of HarfBuzz, a text shaping library. |
6 * | 6 * |
7 * Permission is hereby granted, without written agreement and without | 7 * Permission is hereby granted, without written agreement and without |
8 * license or royalty fees, to use, copy, modify, and distribute this | 8 * license or royalty fees, to use, copy, modify, and distribute this |
9 * software and its documentation for any purpose, provided that the | 9 * software and its documentation for any purpose, provided that the |
10 * above copyright notice and the following two paragraphs appear in | 10 * above copyright notice and the following two paragraphs appear in |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 { | 295 { |
296 /* Same loop as hb_form_clusters(). | 296 /* Same loop as hb_form_clusters(). |
297 * Since form_clusters() merged clusters already, we don't merge. */ | 297 * Since form_clusters() merged clusters already, we don't merge. */ |
298 unsigned int base = 0; | 298 unsigned int base = 0; |
299 unsigned int count = buffer->len; | 299 unsigned int count = buffer->len; |
300 hb_glyph_info_t *info = buffer->info; | 300 hb_glyph_info_t *info = buffer->info; |
301 for (unsigned int i = 1; i < count; i++) | 301 for (unsigned int i = 1; i < count; i++) |
302 { | 302 { |
303 if (likely (!HB_UNICODE_GENERAL_CATEGORY_IS_MARK (_hb_glyph_info_get_gener
al_category (&info[i])))) | 303 if (likely (!HB_UNICODE_GENERAL_CATEGORY_IS_MARK (_hb_glyph_info_get_gener
al_category (&info[i])))) |
304 { | 304 { |
305 buffer->reverse_range (base, i); | |
306 if (buffer->cluster_level == HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARACTERS
) | 305 if (buffer->cluster_level == HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARACTERS
) |
307 buffer->merge_clusters (base, i); | 306 buffer->merge_clusters (base, i); |
| 307 buffer->reverse_range (base, i); |
| 308 |
308 base = i; | 309 base = i; |
309 } | 310 } |
310 } | 311 } |
311 buffer->reverse_range (base, count); | |
312 if (buffer->cluster_level == HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARACTERS) | 312 if (buffer->cluster_level == HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARACTERS) |
313 buffer->merge_clusters (base, count); | 313 buffer->merge_clusters (base, count); |
| 314 buffer->reverse_range (base, count); |
314 | 315 |
315 buffer->reverse (); | 316 buffer->reverse (); |
316 | 317 |
317 buffer->props.direction = HB_DIRECTION_REVERSE (buffer->props.direction); | 318 buffer->props.direction = HB_DIRECTION_REVERSE (buffer->props.direction); |
318 } | 319 } |
319 } | 320 } |
320 | 321 |
321 | 322 |
322 /* Substitute */ | 323 /* Substitute */ |
323 | 324 |
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
882 hb_set_t copy; | 883 hb_set_t copy; |
883 copy.init (); | 884 copy.init (); |
884 do { | 885 do { |
885 copy.set (glyphs); | 886 copy.set (glyphs); |
886 for (hb_codepoint_t lookup_index = -1; hb_set_next (&lookups, &lookup_index)
;) | 887 for (hb_codepoint_t lookup_index = -1; hb_set_next (&lookups, &lookup_index)
;) |
887 hb_ot_layout_lookup_substitute_closure (font->face, lookup_index, glyphs); | 888 hb_ot_layout_lookup_substitute_closure (font->face, lookup_index, glyphs); |
888 } while (!copy.is_equal (glyphs)); | 889 } while (!copy.is_equal (glyphs)); |
889 | 890 |
890 hb_shape_plan_destroy (shape_plan); | 891 hb_shape_plan_destroy (shape_plan); |
891 } | 892 } |
OLD | NEW |