From 7dc561984bdb1f29f09ae0793195b5fbf772522b Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 22 Nov 2018 14:45:46 -0500 Subject: [PATCH] [myanmar] If there's no GSUB table, pick myanmar shaper Needed for morx+kern mark-zeroing interaction. All other scripts work this way. --- src/hb-ot-shape-complex.hh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/hb-ot-shape-complex.hh b/src/hb-ot-shape-complex.hh index e69dce77f..752224617 100644 --- a/src/hb-ot-shape-complex.hh +++ b/src/hb-ot-shape-complex.hh @@ -268,10 +268,19 @@ hb_ot_shape_complex_categorize (const hb_ot_shape_planner_t *planner) return &_hb_ot_complex_shaper_khmer; case HB_SCRIPT_MYANMAR: - if (planner->map.chosen_script[0] == HB_TAG ('m','y','m','2')) - return &_hb_ot_complex_shaper_myanmar; - else + /* If the designer designed the font for the 'DFLT' script, + * (or we ended up arbitrarily pick 'latn'), use the default shaper. + * Otherwise, use the specific shaper. + * + * If designer designed for 'mymr' tag, also send to default + * shaper. That's tag used from before Myanmar shaping spec + * was developed. The shaping spec uses 'mym2' tag. */ + if (planner->map.chosen_script[0] == HB_TAG ('D','F','L','T') || + planner->map.chosen_script[0] == HB_TAG ('l','a','t','n') || + planner->map.chosen_script[0] == HB_TAG ('m','y','m','r')) return &_hb_ot_complex_shaper_default; + else + return &_hb_ot_complex_shaper_myanmar; /* Unicode-2.0 additions */ @@ -373,6 +382,7 @@ hb_ot_shape_complex_categorize (const hb_ot_shape_planner_t *planner) else return &_hb_ot_complex_shaper_use; + /* https://github.com/harfbuzz/harfbuzz/issues/1162 */ case HB_SCRIPT_MYANMAR_ZAWGYI: