#include "hb-ot-map-private.hh"
-#include "hb-ot-shape-private.hh"
-
void
hb_ot_map_t::add_lookups (hb_face_t *face,
}
}
}
-
-
struct hb_ot_shape_plan_t
{
+ const hb_ot_complex_shaper_t *shaper;
hb_ot_map_t map;
+};
+
+struct hb_ot_shape_planner_t
+{
+ /* In the order that they are filled in. */
+ hb_face_t *face;
+ hb_segment_properties_t props;
const hb_ot_complex_shaper_t *shaper;
+ hb_ot_map_builder_t map;
+
+ hb_ot_shape_planner_t (const hb_shape_plan_t *master_plan) :
+ face (master_plan->face),
+ props (master_plan->props),
+ shaper (NULL),
+ map () {}
+ ~hb_ot_shape_planner_t (void) { map.finish (); }
+
+ inline void compile (hb_ot_shape_plan_t &plan)
+ {
+ plan.shaper = shaper;
+ map.compile (face, &props, plan.map);
+ }
+
+ private:
+ NO_COPY (hb_ot_shape_planner_t);
};
+
inline void
_hb_glyph_info_set_unicode_props (hb_glyph_info_t *info, hb_unicode_funcs_t *unicode)
{
-struct hb_ot_shape_planner_t
-{
- hb_ot_map_builder_t map;
- const hb_ot_complex_shaper_t *shaper;
-
- hb_ot_shape_planner_t (void) : map () {}
- ~hb_ot_shape_planner_t (void) { map.finish (); }
-
- inline void compile (hb_face_t *face,
- const hb_segment_properties_t *props,
- hb_ot_shape_plan_t &plan)
- {
- plan.shaper = shaper;
- map.compile (face, props, plan.map);
- }
-
- private:
- NO_COPY (hb_ot_shape_planner_t);
-};
-
static void
hb_ot_shape_collect_features (hb_ot_shape_planner_t *planner,
const hb_segment_properties_t *props,
if (unlikely (!data))
return NULL;
- hb_ot_shape_planner_t planner;
-
- assert (HB_DIRECTION_IS_VALID (shape_plan->props.direction));
+ hb_ot_shape_planner_t planner (shape_plan);
planner.shaper = hb_ot_shape_complex_categorize (&shape_plan->props);
hb_ot_shape_collect_features (&planner, &shape_plan->props, user_features, num_user_features);
- planner.compile (shape_plan->face, &shape_plan->props, *data);
+ planner.compile (*data);
return data;
}
unsigned int num_user_features,
const char * const *shaper_list)
{
+ assert (props->direction != HB_DIRECTION_INVALID);
+
hb_shape_plan_t *shape_plan;
if (unlikely (!face))
buffer->guess_properties ();
- assert (buffer->props.direction != HB_DIRECTION_INVALID);
-
hb_shape_plan_t *shape_plan = hb_shape_plan_create_cached (font->face, &buffer->props, features, num_features, shaper_list);
hb_bool_t res = hb_shape_plan_execute (shape_plan, font, buffer, features, num_features);
hb_shape_plan_destroy (shape_plan);