From b5584ee4be46b47e1678acf28426970a6d670b4f Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 23 Aug 2012 16:26:07 -0400 Subject: [PATCH] [Indic] For old-spec, match non-zero context Fixes consonant-position with old-spec Malayalam. Uniscribe seem to be doing this. Fixes below-base La (eg. Pa,H,La) with AnjaliNewLipi.ttf. Doesn't regress new-spec or other scripts. --- src/hb-ot-shape-complex-indic.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc index 0df179c..b2513ef 100644 --- a/src/hb-ot-shape-complex-indic.cc +++ b/src/hb-ot-shape-complex-indic.cc @@ -254,10 +254,11 @@ struct would_substitute_feature_t inline bool would_substitute (hb_codepoint_t *glyphs, unsigned int glyphs_count, + bool zero_context, hb_face_t *face) const { for (unsigned int i = 0; i < count; i++) - if (hb_ot_layout_would_substitute_lookup_fast (face, lookups[i].index, glyphs, glyphs_count, true)) + if (hb_ot_layout_would_substitute_lookup_fast (face, lookups[i].index, glyphs, glyphs_count, zero_context)) return true; return false; } @@ -340,9 +341,10 @@ consonant_position_from_face (const indic_shape_plan_t *indic_plan, hb_codepoint_t *glyphs, unsigned int glyphs_len, hb_face_t *face) { - if (indic_plan->pref.would_substitute (glyphs, glyphs_len, face)) return POS_BELOW_C; - if (indic_plan->blwf.would_substitute (glyphs, glyphs_len, face)) return POS_BELOW_C; - if (indic_plan->pstf.would_substitute (glyphs, glyphs_len, face)) return POS_POST_C; + bool zero_context = indic_plan->is_old_spec ? false : true; + if (indic_plan->pref.would_substitute (glyphs, glyphs_len, zero_context, face)) return POS_BELOW_C; + if (indic_plan->blwf.would_substitute (glyphs, glyphs_len, zero_context, face)) return POS_BELOW_C; + if (indic_plan->pstf.would_substitute (glyphs, glyphs_len, zero_context, face)) return POS_POST_C; return POS_BASE_C; } -- 2.7.4