From 57c55ef8341c760145170dedd002c5afb380e6c8 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 2 Oct 2017 18:21:27 +0200 Subject: [PATCH] [ot] Improve shaper selection heuristic --- src/hb-ot-shape-complex-private.hh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/hb-ot-shape-complex-private.hh b/src/hb-ot-shape-complex-private.hh index 20ad6b2c7..8fadd7cdb 100644 --- a/src/hb-ot-shape-complex-private.hh +++ b/src/hb-ot-shape-complex-private.hh @@ -253,10 +253,12 @@ hb_ot_shape_complex_categorize (const hb_ot_shape_planner_t *planner) case HB_SCRIPT_SINHALA: /* If the designer designed the font for the 'DFLT' script, - * use the default shaper. Otherwise, use the specific shaper. + * (or we ended up arbitrarily pick 'latn'), use the default shaper. + * Otherwise, use the specific shaper. * Note that for some simple scripts, there may not be *any* * GSUB/GPOS needed, so there may be no scripts found! */ - if (planner->map.chosen_script[0] == HB_TAG ('D','F','L','T')) + if (planner->map.chosen_script[0] == HB_TAG ('D','F','L','T') || + planner->map.chosen_script[0] == HB_TAG ('l','a','t','n')) return &_hb_ot_complex_shaper_default; else return &_hb_ot_complex_shaper_indic; @@ -368,10 +370,12 @@ hb_ot_shape_complex_categorize (const hb_ot_shape_planner_t *planner) case HB_SCRIPT_ZANABAZAR_SQUARE: /* If the designer designed the font for the 'DFLT' script, - * use the default shaper. Otherwise, use the specific shaper. + * (or we ended up arbitrarily pick 'latn'), use the default shaper. + * Otherwise, use the specific shaper. * Note that for some simple scripts, there may not be *any* * GSUB/GPOS needed, so there may be no scripts found! */ - if (planner->map.chosen_script[0] == HB_TAG ('D','F','L','T')) + if (planner->map.chosen_script[0] == HB_TAG ('D','F','L','T') || + planner->map.chosen_script[0] == HB_TAG ('l','a','t','n')) return &_hb_ot_complex_shaper_default; else return &_hb_ot_complex_shaper_use;