From 9e92978c8aa3d3cdab4d20c81698c56adbb3dbdd Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 12 Nov 2012 18:36:10 -0800 Subject: [PATCH] [Indic] Route "new" Myanmar tag through the Indic shaper Windows 8 adds a Myanmar shaper using the 'mym2' tag. Route that through the Indic shaper. It's still very broken, but at least this does NOT break old-style Myanmar shaping using the generic shaper. --- src/hb-ot-shape-complex-private.hh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/hb-ot-shape-complex-private.hh b/src/hb-ot-shape-complex-private.hh index ddad5d2b7..a45b0f486 100644 --- a/src/hb-ot-shape-complex-private.hh +++ b/src/hb-ot-shape-complex-private.hh @@ -135,6 +135,8 @@ hb_ot_shape_complex_categorize (const hb_ot_shape_planner_t *planner) /* Unicode-6.0 additions */ case HB_SCRIPT_MANDAIC: + /* For Arabic script, use the Arabic shaper even if no OT script tag was found. + * This is because we do fallback shaping for Arabic script (and not others). */ if (planner->map.chosen_script[0] != HB_OT_TAG_DEFAULT_SCRIPT || planner->props.script == HB_SCRIPT_ARABIC) return &_hb_ot_complex_shaper_arabic; @@ -208,12 +210,6 @@ hb_ot_shape_complex_categorize (const hb_ot_shape_planner_t *planner) case HB_SCRIPT_TAI_VIET: - /* May need Indic treatment in the future? */ - - /* Unicode-3.0 additions */ - case HB_SCRIPT_MYANMAR: - - #endif /* Unicode-1.1 additions */ @@ -229,6 +225,7 @@ hb_ot_shape_complex_categorize (const hb_ot_shape_planner_t *planner) /* Unicode-3.0 additions */ case HB_SCRIPT_KHMER: + case HB_SCRIPT_MYANMAR: case HB_SCRIPT_SINHALA: /* Unicode-4.1 additions */ @@ -257,7 +254,10 @@ hb_ot_shape_complex_categorize (const hb_ot_shape_planner_t *planner) case HB_SCRIPT_SHARADA: case HB_SCRIPT_TAKRI: - if (planner->map.chosen_script[0] != HB_OT_TAG_DEFAULT_SCRIPT) + /* For Myanmar, we only want to use the Indic shaper if the "new" script + * tag is found. For "old" script tag we want to use the default shaper. */ + if (planner->map.chosen_script[0] != HB_OT_TAG_DEFAULT_SCRIPT && + planner->map.chosen_script[0] != HB_TAG ('m','y','m','r')) return &_hb_ot_complex_shaper_indic; else return &_hb_ot_complex_shaper_default;