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 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
686 FAIL ("Buffer resize failed"); | 686 FAIL ("Buffer resize failed"); |
687 | 687 |
688 /* Adjust scratch, pchars, and log_cluster arrays. This is ugly, but really
the | 688 /* Adjust scratch, pchars, and log_cluster arrays. This is ugly, but really
the |
689 * cleanest way to do without completely restructuring the rest of this shap
er. */ | 689 * cleanest way to do without completely restructuring the rest of this shap
er. */ |
690 scratch = buffer->get_scratch_buffer (&scratch_size); | 690 scratch = buffer->get_scratch_buffer (&scratch_size); |
691 pchars = reinterpret_cast<UniChar *> (((char *) scratch + ((char *) pchars -
(char *) old_scratch))); | 691 pchars = reinterpret_cast<UniChar *> (((char *) scratch + ((char *) pchars -
(char *) old_scratch))); |
692 log_clusters = reinterpret_cast<unsigned int *> (((char *) scratch + ((char
*) log_clusters - (char *) old_scratch))); | 692 log_clusters = reinterpret_cast<unsigned int *> (((char *) scratch + ((char
*) log_clusters - (char *) old_scratch))); |
693 scratch += old_scratch_used; | 693 scratch += old_scratch_used; |
694 scratch_size -= old_scratch_used; | 694 scratch_size -= old_scratch_used; |
695 } | 695 } |
696 retry: | |
697 { | 696 { |
698 string_ref = CFStringCreateWithCharactersNoCopy (NULL, | 697 string_ref = CFStringCreateWithCharactersNoCopy (NULL, |
699 pchars, chars_len, | 698 pchars, chars_len, |
700 kCFAllocatorNull); | 699 kCFAllocatorNull); |
701 if (unlikely (!string_ref)) | 700 if (unlikely (!string_ref)) |
702 FAIL ("CFStringCreateWithCharactersNoCopy failed"); | 701 FAIL ("CFStringCreateWithCharactersNoCopy failed"); |
703 | 702 |
704 /* Create an attributed string, populate it, and create a line from it, then
release attributed string. */ | 703 /* Create an attributed string, populate it, and create a line from it, then
release attributed string. */ |
705 { | 704 { |
706 CFMutableAttributedStringRef attr_string = CFAttributedStringCreateMutable
(kCFAllocatorDefault, | 705 CFMutableAttributedStringRef attr_string = CFAttributedStringCreateMutable
(kCFAllocatorDefault, |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1122 CFRelease (range_records[i].font); | 1121 CFRelease (range_records[i].font); |
1123 | 1122 |
1124 return ret; | 1123 return ret; |
1125 } | 1124 } |
1126 | 1125 |
1127 | 1126 |
1128 /* | 1127 /* |
1129 * AAT shaper | 1128 * AAT shaper |
1130 */ | 1129 */ |
1131 | 1130 |
1132 HB_SHAPER_DATA_ENSURE_DECLARE(coretext_aat, face) | |
1133 HB_SHAPER_DATA_ENSURE_DECLARE(coretext_aat, font) | |
1134 | |
1135 | |
1136 /* | 1131 /* |
1137 * shaper face data | 1132 * shaper face data |
1138 */ | 1133 */ |
1139 | 1134 |
1140 struct hb_coretext_aat_shaper_face_data_t {}; | 1135 struct hb_coretext_aat_shaper_face_data_t {}; |
1141 | 1136 |
1142 hb_coretext_aat_shaper_face_data_t * | 1137 hb_coretext_aat_shaper_face_data_t * |
1143 _hb_coretext_aat_shaper_face_data_create (hb_face_t *face) | 1138 _hb_coretext_aat_shaper_face_data_create (hb_face_t *face) |
1144 { | 1139 { |
1145 hb_blob_t *mort_blob = face->reference_table (HB_CORETEXT_TAG_MORT); | 1140 hb_blob_t *mort_blob = face->reference_table (HB_CORETEXT_TAG_MORT); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1210 | 1205 |
1211 hb_bool_t | 1206 hb_bool_t |
1212 _hb_coretext_aat_shape (hb_shape_plan_t *shape_plan, | 1207 _hb_coretext_aat_shape (hb_shape_plan_t *shape_plan, |
1213 hb_font_t *font, | 1208 hb_font_t *font, |
1214 hb_buffer_t *buffer, | 1209 hb_buffer_t *buffer, |
1215 const hb_feature_t *features, | 1210 const hb_feature_t *features, |
1216 unsigned int num_features) | 1211 unsigned int num_features) |
1217 { | 1212 { |
1218 return _hb_coretext_shape (shape_plan, font, buffer, features, num_features); | 1213 return _hb_coretext_shape (shape_plan, font, buffer, features, num_features); |
1219 } | 1214 } |
OLD | NEW |