176 const int *coords,
177 unsigned int num_coords)
178 {
179 hb_ot_shape_plan_t *plan = (hb_ot_shape_plan_t *) calloc (1, sizeof (hb_ot_shape_plan_t));
180 if (unlikely (!plan))
181 return nullptr;
182
183 plan->init ();
184
185 hb_ot_shape_planner_t planner (shape_plan);
186
187 planner.shaper = hb_ot_shape_complex_categorize (&planner);
188
189 hb_ot_shape_collect_features (&planner, &shape_plan->props,
190 user_features, num_user_features);
191
192 planner.compile (*plan, coords, num_coords);
193
194 if (plan->shaper->data_create) {
195 plan->data = plan->shaper->data_create (plan);
196 if (unlikely (!plan->data))
197 return nullptr;
198 }
199
200 return plan;
201 }
202
203 void
204 _hb_ot_shaper_shape_plan_data_destroy (hb_ot_shaper_shape_plan_data_t *plan)
205 {
206 if (plan->shaper->data_destroy)
207 plan->shaper->data_destroy (const_cast<void *> (plan->data));
208
209 plan->fini ();
210
211 free (plan);
212 }
213
214
215 /*
216 * shaper
217 */
|
176 const int *coords,
177 unsigned int num_coords)
178 {
179 hb_ot_shape_plan_t *plan = (hb_ot_shape_plan_t *) calloc (1, sizeof (hb_ot_shape_plan_t));
180 if (unlikely (!plan))
181 return nullptr;
182
183 plan->init ();
184
185 hb_ot_shape_planner_t planner (shape_plan);
186
187 planner.shaper = hb_ot_shape_complex_categorize (&planner);
188
189 hb_ot_shape_collect_features (&planner, &shape_plan->props,
190 user_features, num_user_features);
191
192 planner.compile (*plan, coords, num_coords);
193
194 if (plan->shaper->data_create) {
195 plan->data = plan->shaper->data_create (plan);
196 if (unlikely (!plan->data)) {
197 free(plan);
198 return nullptr;
199 }
200 }
201
202 return plan;
203 }
204
205 void
206 _hb_ot_shaper_shape_plan_data_destroy (hb_ot_shaper_shape_plan_data_t *plan)
207 {
208 if (plan->shaper->data_destroy)
209 plan->shaper->data_destroy (const_cast<void *> (plan->data));
210
211 plan->fini ();
212
213 free (plan);
214 }
215
216
217 /*
218 * shaper
219 */
|