OLD | NEW |
1 /* | 1 /* |
2 * Copyright © 1998-2004 David Turner and Werner Lemberg | 2 * Copyright © 1998-2004 David Turner and Werner Lemberg |
3 * Copyright © 2004,2007,2009,2010 Red Hat, Inc. | 3 * Copyright © 2004,2007,2009,2010 Red Hat, Inc. |
4 * Copyright © 2011,2012 Google, Inc. | 4 * Copyright © 2011,2012 Google, Inc. |
5 * | 5 * |
6 * This is part of HarfBuzz, a text shaping library. | 6 * This is part of HarfBuzz, a text shaping library. |
7 * | 7 * |
8 * Permission is hereby granted, without written agreement and without | 8 * Permission is hereby granted, without written agreement and without |
9 * license or royalty fees, to use, copy, modify, and distribute this | 9 * license or royalty fees, to use, copy, modify, and distribute this |
10 * software and its documentation for any purpose, provided that the | 10 * software and its documentation for any purpose, provided that the |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 if (cluster_start <= info[i].cluster && info[i].cluster < cluster_end) | 436 if (cluster_start <= info[i].cluster && info[i].cluster < cluster_end) |
437 info[i].mask = (info[i].mask & not_mask) | value; | 437 info[i].mask = (info[i].mask & not_mask) | value; |
438 } | 438 } |
439 | 439 |
440 void | 440 void |
441 hb_buffer_t::reverse_range (unsigned int start, | 441 hb_buffer_t::reverse_range (unsigned int start, |
442 unsigned int end) | 442 unsigned int end) |
443 { | 443 { |
444 unsigned int i, j; | 444 unsigned int i, j; |
445 | 445 |
446 if (start == end - 1) | 446 if (end - start < 2) |
447 return; | 447 return; |
448 | 448 |
449 for (i = start, j = end - 1; i < j; i++, j--) { | 449 for (i = start, j = end - 1; i < j; i++, j--) { |
450 hb_glyph_info_t t; | 450 hb_glyph_info_t t; |
451 | 451 |
452 t = info[i]; | 452 t = info[i]; |
453 info[i] = info[j]; | 453 info[i] = info[j]; |
454 info[j] = t; | 454 info[j] = t; |
455 } | 455 } |
456 | 456 |
(...skipping 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1585 | 1585 |
1586 unsigned int start = 0; | 1586 unsigned int start = 0; |
1587 unsigned int end; | 1587 unsigned int end; |
1588 for (end = start + 1; end < count; end++) | 1588 for (end = start + 1; end < count; end++) |
1589 if (info[start].cluster != info[end].cluster) { | 1589 if (info[start].cluster != info[end].cluster) { |
1590 normalize_glyphs_cluster (buffer, start, end, backward); | 1590 normalize_glyphs_cluster (buffer, start, end, backward); |
1591 start = end; | 1591 start = end; |
1592 } | 1592 } |
1593 normalize_glyphs_cluster (buffer, start, end, backward); | 1593 normalize_glyphs_cluster (buffer, start, end, backward); |
1594 } | 1594 } |
OLD | NEW |