OLD | NEW |
1 /* | 1 /* |
2 * Copyright © 2012,2013 Mozilla Foundation. | 2 * Copyright © 2012,2013 Mozilla Foundation. |
3 * Copyright © 2012,2013 Google, Inc. | 3 * Copyright © 2012,2013 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 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
725 ALLOCATE_ARRAY (UniChar, pchars, buffer->len * 2, /*nothing*/); | 725 ALLOCATE_ARRAY (UniChar, pchars, buffer->len * 2, /*nothing*/); |
726 unsigned int chars_len = 0; | 726 unsigned int chars_len = 0; |
727 for (unsigned int i = 0; i < buffer->len; i++) { | 727 for (unsigned int i = 0; i < buffer->len; i++) { |
728 hb_codepoint_t c = buffer->info[i].codepoint; | 728 hb_codepoint_t c = buffer->info[i].codepoint; |
729 if (likely (c <= 0xFFFFu)) | 729 if (likely (c <= 0xFFFFu)) |
730 pchars[chars_len++] = c; | 730 pchars[chars_len++] = c; |
731 else if (unlikely (c > 0x10FFFFu)) | 731 else if (unlikely (c > 0x10FFFFu)) |
732 pchars[chars_len++] = 0xFFFDu; | 732 pchars[chars_len++] = 0xFFFDu; |
733 else { | 733 else { |
734 pchars[chars_len++] = 0xD800u + ((c - 0x10000u) >> 10); | 734 pchars[chars_len++] = 0xD800u + ((c - 0x10000u) >> 10); |
735 pchars[chars_len++] = 0xDC00u + ((c - 0x10000u) & ((1 << 10) - 1)); | 735 pchars[chars_len++] = 0xDC00u + ((c - 0x10000u) & ((1u << 10) - 1)); |
736 } | 736 } |
737 } | 737 } |
738 | 738 |
739 ALLOCATE_ARRAY (unsigned int, log_clusters, chars_len, /*nothing*/); | 739 ALLOCATE_ARRAY (unsigned int, log_clusters, chars_len, /*nothing*/); |
740 chars_len = 0; | 740 chars_len = 0; |
741 for (unsigned int i = 0; i < buffer->len; i++) | 741 for (unsigned int i = 0; i < buffer->len; i++) |
742 { | 742 { |
743 hb_codepoint_t c = buffer->info[i].codepoint; | 743 hb_codepoint_t c = buffer->info[i].codepoint; |
744 unsigned int cluster = buffer->info[i].cluster; | 744 unsigned int cluster = buffer->info[i].cluster; |
745 log_clusters[chars_len++] = cluster; | 745 log_clusters[chars_len++] = cluster; |
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1296 | 1296 |
1297 hb_bool_t | 1297 hb_bool_t |
1298 _hb_coretext_aat_shape (hb_shape_plan_t *shape_plan, | 1298 _hb_coretext_aat_shape (hb_shape_plan_t *shape_plan, |
1299 hb_font_t *font, | 1299 hb_font_t *font, |
1300 hb_buffer_t *buffer, | 1300 hb_buffer_t *buffer, |
1301 const hb_feature_t *features, | 1301 const hb_feature_t *features, |
1302 unsigned int num_features) | 1302 unsigned int num_features) |
1303 { | 1303 { |
1304 return _hb_coretext_shape (shape_plan, font, buffer, features, num_features); | 1304 return _hb_coretext_shape (shape_plan, font, buffer, features, num_features); |
1305 } | 1305 } |
OLD | NEW |