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
This commit is contained in:
Behdad Esfahbod 2014-02-18 15:53:56 -05:00
parent b456d42bf6
commit a82165248c
2 changed files with 3 additions and 1 deletions

View File

@ -70,7 +70,7 @@ compose_hebrew (const hb_ot_shape_normalize_context_t *c,
bool found = c->unicode->compose (a, b, ab); 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 /* Special-case Hebrew presentation forms that are excluded from
* standard normalization, but wanted for old fonts. */ * standard normalization, but wanted for old fonts. */

View File

@ -44,6 +44,7 @@ struct hb_ot_shape_plan_t
hb_mask_t kern_mask; hb_mask_t kern_mask;
unsigned int has_frac : 1; unsigned int has_frac : 1;
unsigned int has_kern : 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 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_frac = plan.frac_mask || (plan.numr_mask && plan.dnom_mask);
plan.has_kern = !!plan.kern_mask; plan.has_kern = !!plan.kern_mask;
plan.has_mark = !!plan.map.get_1_mask (HB_TAG ('m','a','r','k'));
} }
private: private: