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 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1150 hb_blob_destroy (mort_blob); | 1149 hb_blob_destroy (mort_blob); |
1151 mort_blob = face->reference_table (HB_CORETEXT_TAG_MORX); | 1150 mort_blob = face->reference_table (HB_CORETEXT_TAG_MORX); |
1152 if (!hb_blob_get_length (mort_blob)) | 1151 if (!hb_blob_get_length (mort_blob)) |
1153 { | 1152 { |
1154 hb_blob_destroy (mort_blob); | 1153 hb_blob_destroy (mort_blob); |
1155 return NULL; | 1154 return NULL; |
1156 } | 1155 } |
1157 } | 1156 } |
1158 hb_blob_destroy (mort_blob); | 1157 hb_blob_destroy (mort_blob); |
1159 | 1158 |
1160 return hb_coretext_shaper_face_data_ensure (face) ? (hb_coretext_aat_shaper_fa
ce_data_t *) HB_SHAPER_DATA_SUCCEEDED : NULL; | 1159 return hb_coretext_aat_shaper_face_data_ensure (face) ? (hb_coretext_aat_shape
r_face_data_t *) HB_SHAPER_DATA_SUCCEEDED : NULL; |
1161 } | 1160 } |
1162 | 1161 |
1163 void | 1162 void |
1164 _hb_coretext_aat_shaper_face_data_destroy (hb_coretext_aat_shaper_face_data_t *d
ata HB_UNUSED) | 1163 _hb_coretext_aat_shaper_face_data_destroy (hb_coretext_aat_shaper_face_data_t *d
ata HB_UNUSED) |
1165 { | 1164 { |
1166 } | 1165 } |
1167 | 1166 |
1168 | 1167 |
1169 /* | 1168 /* |
1170 * shaper font data | 1169 * shaper font data |
1171 */ | 1170 */ |
1172 | 1171 |
1173 struct hb_coretext_aat_shaper_font_data_t {}; | 1172 struct hb_coretext_aat_shaper_font_data_t {}; |
1174 | 1173 |
1175 hb_coretext_aat_shaper_font_data_t * | 1174 hb_coretext_aat_shaper_font_data_t * |
1176 _hb_coretext_aat_shaper_font_data_create (hb_font_t *font) | 1175 _hb_coretext_aat_shaper_font_data_create (hb_font_t *font) |
1177 { | 1176 { |
1178 return hb_coretext_shaper_font_data_ensure (font) ? (hb_coretext_aat_shaper_fo
nt_data_t *) HB_SHAPER_DATA_SUCCEEDED : NULL; | 1177 return hb_coretext_aat_shaper_font_data_ensure (font) ? (hb_coretext_aat_shape
r_font_data_t *) HB_SHAPER_DATA_SUCCEEDED : NULL; |
1179 } | 1178 } |
1180 | 1179 |
1181 void | 1180 void |
1182 _hb_coretext_aat_shaper_font_data_destroy (hb_coretext_aat_shaper_font_data_t *d
ata HB_UNUSED) | 1181 _hb_coretext_aat_shaper_font_data_destroy (hb_coretext_aat_shaper_font_data_t *d
ata HB_UNUSED) |
1183 { | 1182 { |
1184 } | 1183 } |
1185 | 1184 |
1186 | 1185 |
1187 /* | 1186 /* |
1188 * shaper shape_plan data | 1187 * shaper shape_plan data |
(...skipping 21 matching lines...) Expand all Loading... |
1210 | 1209 |
1211 hb_bool_t | 1210 hb_bool_t |
1212 _hb_coretext_aat_shape (hb_shape_plan_t *shape_plan, | 1211 _hb_coretext_aat_shape (hb_shape_plan_t *shape_plan, |
1213 hb_font_t *font, | 1212 hb_font_t *font, |
1214 hb_buffer_t *buffer, | 1213 hb_buffer_t *buffer, |
1215 const hb_feature_t *features, | 1214 const hb_feature_t *features, |
1216 unsigned int num_features) | 1215 unsigned int num_features) |
1217 { | 1216 { |
1218 return _hb_coretext_shape (shape_plan, font, buffer, features, num_features); | 1217 return _hb_coretext_shape (shape_plan, font, buffer, features, num_features); |
1219 } | 1218 } |
OLD | NEW |