Choose shaper based on chosen OT script tag

For Arabic and Indic shapers, if the font doesn't have a script system
for the script, use default shaper.

Make an exception for Arabic script since we have fallback logic for
that one.
This commit is contained in:
Behdad Esfahbod 2012-11-12 18:27:42 -08:00
parent 9b37b4c580
commit 5ab3855f81
2 changed files with 13 additions and 2 deletions

View File

@ -194,12 +194,16 @@ struct hb_ot_map_builder_t
HB_INTERNAL void add_pause (unsigned int table_index, hb_ot_map_t::pause_func_t pause_func);
public:
hb_face_t *face;
hb_segment_properties_t props;
hb_tag_t chosen_script[2];
unsigned int script_index[2], language_index[2];
private:
unsigned int current_stage[2]; /* GSUB/GPOS */
hb_prealloced_array_t<feature_info_t,16> feature_infos;
hb_prealloced_array_t<pause_info_t, 1> pauses[2]; /* GSUB/GPOS */

View File

@ -135,7 +135,11 @@ hb_ot_shape_complex_categorize (const hb_ot_shape_planner_t *planner)
/* Unicode-6.0 additions */
case HB_SCRIPT_MANDAIC:
return &_hb_ot_complex_shaper_arabic;
if (planner->map.chosen_script[0] != HB_OT_TAG_DEFAULT_SCRIPT ||
planner->props.script == HB_SCRIPT_ARABIC)
return &_hb_ot_complex_shaper_arabic;
else
return &_hb_ot_complex_shaper_default;
/* Unicode-1.1 additions */
@ -253,7 +257,10 @@ hb_ot_shape_complex_categorize (const hb_ot_shape_planner_t *planner)
case HB_SCRIPT_SHARADA:
case HB_SCRIPT_TAKRI:
return &_hb_ot_complex_shaper_indic;
if (planner->map.chosen_script[0] != HB_OT_TAG_DEFAULT_SCRIPT)
return &_hb_ot_complex_shaper_indic;
else
return &_hb_ot_complex_shaper_default;
}
}