From 5360ce0c5c33f921b3f9ad3f42529a19df5ad0fe Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 7 Oct 2010 21:21:11 -0400 Subject: [PATCH] Move some more code around --- src/hb-ot-shape.cc | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc index dd7a546..a206ff9 100644 --- a/src/hb-ot-shape.cc +++ b/src/hb-ot-shape.cc @@ -249,20 +249,6 @@ hb_ot_shape_setup_lookups (hb_ot_shape_context_t *c, lookup_map *lookups, unsigned int *num_lookups) { - unsigned int script_index, language_index, feature_index; - unsigned int room_lookups; - - room_lookups = *num_lookups; - *num_lookups = 0; - - hb_ot_layout_table_choose_script (c->face, c->table_tag, - hb_ot_tags_from_script (c->buffer->props.script), - &script_index); - hb_ot_layout_script_find_language (c->face, c->table_tag, script_index, - hb_ot_tag_from_language (c->buffer->props.language), - &language_index); - - hb_mask_allocator_t allocator; switch (c->original_direction) { @@ -292,11 +278,24 @@ hb_ot_shape_setup_lookups (hb_ot_shape_context_t *c, /* Compile features */ + unsigned int script_index, language_index, feature_index; + unsigned int room_lookups; + + hb_ot_layout_table_choose_script (c->face, c->table_tag, + hb_ot_tags_from_script (c->buffer->props.script), + &script_index); + hb_ot_layout_script_find_language (c->face, c->table_tag, script_index, + hb_ot_tag_from_language (c->buffer->props.language), + &language_index); + allocator.compile (c->face, c->table_tag, script_index, language_index); /* Gather lookup indices for features */ + room_lookups = *num_lookups; + *num_lookups = 0; + if (hb_ot_layout_language_get_required_feature_index (c->face, c->table_tag, script_index, language_index, &feature_index)) add_lookups (c->face, c->table_tag, feature_index, 1, lookups, num_lookups, room_lookups); -- 2.7.4