From: Behdad Esfahbod Date: Fri, 20 Jul 2012 14:30:24 +0000 (-0400) Subject: [Indic] Unbreak old scriptures X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=51e764de441072e7c9f67de23e8ed717b9b8957d;p=platform%2Fupstream%2FlibHarfBuzzSharp.git [Indic] Unbreak old scriptures Brings down failures with Lohit-Telugu from 57% to 1.40%. --- diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc index 43eaf83..42e0f70 100644 --- a/src/hb-ot-shape-complex-indic.cc +++ b/src/hb-ot-shape-complex-indic.cc @@ -123,8 +123,9 @@ consonant_position (hb_codepoint_t u, hb_ot_map_t *map, hb_font_t *font) if ((u & ~0x007F) == 0x0D80) virama = 0x0DCA; /* Sinahla */ hb_codepoint_t glyphs[2]; - hb_font_get_glyph (font, virama, 0, &glyphs[0]); - hb_font_get_glyph (font, u, 0, &glyphs[1]); + unsigned int virama_pos = IS_OLD_INDIC_TAG (map->get_chosen_script (0)) ? 1 : 0; + hb_font_get_glyph (font, virama, 0, &glyphs[virama_pos]); + hb_font_get_glyph (font, u, 0, &glyphs[1-virama_pos]); hb_face_t *face = hb_font_get_face (font); if (would_substitute (glyphs, ARRAY_LENGTH (glyphs), HB_TAG('p','r','e','f'), map, face)) return POS_BELOW_C;