From 98460779bae19e4d64d29461ff154b3527bf8420 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 7 Dec 2015 21:38:47 +0100 Subject: [PATCH] Remove final pause from Arabic shaper Back in the old days, we used to apply 'calt' and 'cswh' in Arabic shaper, with a pause in between. Then we disabled the 'cswh' because Microsoft disabled it, but forgot to remove the unnecessary pause. Do that now. This has the benefit that it fixes shaping with monbaiti from Windows 10. In that version of that font, the lookups from 'calt' are duplicated in 'rclt', and Mongolian was changed to go through Universal Shaping Engine. We still use the Arabic shaper for Mongolian. With a pause after 'calt', we were applying the duplicate lookups from 'calt' and 'rclt' twice. It happened to be the case that these lookups were NOT idempotent. So we were getting wrong shaping. See thread "Windows 10 monbaiti.ttf upgrade (5.01 -> 5.51) caused loss of diacritical marks when shaped with harfbuz" on the mailing list. This fixes that. --- src/hb-ot-shape-complex-arabic.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hb-ot-shape-complex-arabic.cc b/src/hb-ot-shape-complex-arabic.cc index 6d9d09312..8ab9a0239 100644 --- a/src/hb-ot-shape-complex-arabic.cc +++ b/src/hb-ot-shape-complex-arabic.cc @@ -223,7 +223,6 @@ collect_features_arabic (hb_ot_shape_planner_t *plan) map->add_gsub_pause (arabic_fallback_shape); map->add_global_bool_feature (HB_TAG('c','a','l','t')); - map->add_gsub_pause (NULL); /* The spec includes 'cswh'. Earlier versions of Windows * used to enable this by default, but testing suggests @@ -233,6 +232,7 @@ collect_features_arabic (hb_ot_shape_planner_t *plan) * Note that IranNastaliq uses this feature extensively * to fixup broken glyph sequences. Oh well... * Test case: U+0643,U+0640,U+0631. */ + //map->add_gsub_pause (NULL); //map->add_global_bool_feature (HB_TAG('c','s','w','h')); map->add_global_bool_feature (HB_TAG('m','s','e','t')); }