From a82165248cddb720576464b8e59a986491d3f2e9 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 18 Feb 2014 15:53:56 -0500 Subject: [PATCH] Only do fallback Hebrew composition if no GPOS 'mark' available Apparently some modern fonts have proper GPOS mark positioning tables, but undesirable precomposed forms! See thread "Hebrew composition to presentation forms" and: http://tex.stackexchange.com/questions/156775/having-trouble-with-vowel-positioning-in-ezra-sil-xelatex Test case: U+fb1d,05d9,05b4 --- src/hb-ot-shape-complex-hebrew.cc | 2 +- src/hb-ot-shape-private.hh | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hb-ot-shape-complex-hebrew.cc b/src/hb-ot-shape-complex-hebrew.cc index efef8c14a..6bb6043f6 100644 --- a/src/hb-ot-shape-complex-hebrew.cc +++ b/src/hb-ot-shape-complex-hebrew.cc @@ -70,7 +70,7 @@ compose_hebrew (const hb_ot_shape_normalize_context_t *c, bool found = c->unicode->compose (a, b, ab); - if (!found) + if (!found && !c->plan->has_mark) { /* Special-case Hebrew presentation forms that are excluded from * standard normalization, but wanted for old fonts. */ diff --git a/src/hb-ot-shape-private.hh b/src/hb-ot-shape-private.hh index df81fa25d..54ac2c3cf 100644 --- a/src/hb-ot-shape-private.hh +++ b/src/hb-ot-shape-private.hh @@ -44,6 +44,7 @@ struct hb_ot_shape_plan_t hb_mask_t kern_mask; unsigned int has_frac : 1; unsigned int has_kern : 1; + unsigned int has_mark : 1; inline void collect_lookups (hb_tag_t table_tag, hb_set_t *lookups) const { @@ -92,6 +93,7 @@ struct hb_ot_shape_planner_t plan.has_frac = plan.frac_mask || (plan.numr_mask && plan.dnom_mask); plan.has_kern = !!plan.kern_mask; + plan.has_mark = !!plan.map.get_1_mask (HB_TAG ('m','a','r','k')); } private: