From 5ab3855f8106158ee7e68797e8c35e63e9216e5d Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 12 Nov 2012 18:27:42 -0800 Subject: [PATCH] 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. --- src/hb-ot-map-private.hh | 4 ++++ src/hb-ot-shape-complex-private.hh | 11 +++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/hb-ot-map-private.hh b/src/hb-ot-map-private.hh index 71c9fc1ad..11d97e1d5 100644 --- a/src/hb-ot-map-private.hh +++ b/src/hb-ot-map-private.hh @@ -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_infos; hb_prealloced_array_t pauses[2]; /* GSUB/GPOS */ diff --git a/src/hb-ot-shape-complex-private.hh b/src/hb-ot-shape-complex-private.hh index c3e5ba521..ddad5d2b7 100644 --- a/src/hb-ot-shape-complex-private.hh +++ b/src/hb-ot-shape-complex-private.hh @@ -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; } }