From 9a6cf4a39135a9e3dc611bbbab9167f6e5a79b18 Mon Sep 17 00:00:00 2001 From: Aric Stewart Date: Thu, 19 May 2011 11:15:43 -0500 Subject: [PATCH] usp10: If a feature changes a glyph reapply the feature to the new glyph. --- dlls/usp10/shape.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dlls/usp10/shape.c b/dlls/usp10/shape.c index 9263e1903ca..0afb7aa434c 100644 --- a/dlls/usp10/shape.c +++ b/dlls/usp10/shape.c @@ -516,6 +516,9 @@ static INT GSUB_apply_SingleSubst(const GSUB_LookupTable *look, WORD *glyphs, IN TRACE(" Coverage index %i\n",index); if (index != -1) { + if (glyphs[glyph_index] == GET_BE_WORD(ssf2->Substitute[index])) + return GSUB_E_NOGLYPH; + TRACE(" Glyph is 0x%x ->",glyphs[glyph_index]); glyphs[glyph_index] = GET_BE_WORD(ssf2->Substitute[index]); TRACE("0x%x\n",glyphs[glyph_index]); @@ -548,6 +551,8 @@ static INT GSUB_apply_AlternateSubst(const GSUB_LookupTable *look, WORD *glyphs, offset = GET_BE_WORD(asf1->AlternateSet[index]); as = (const GSUB_AlternateSet*)((const BYTE*)asf1+offset); FIXME("%i alternates, picking index 0\n",GET_BE_WORD(as->GlyphCount)); + if (glyphs[glyph_index] == GET_BE_WORD(as->Alternate[0])) + return GSUB_E_NOGLYPH; TRACE(" Glyph 0x%x ->",glyphs[glyph_index]); glyphs[glyph_index] = GET_BE_WORD(as->Alternate[0]); @@ -759,6 +764,13 @@ static INT GSUB_apply_feature(const GSUB_Header * header, const GSUB_Feature* fe } if (out_index == GSUB_E_NOGLYPH) TRACE("lookups found no glyphs\n"); + else + { + int out2; + out2 = GSUB_apply_feature(header, feature, glyphs, glyph_index, write_dir, glyph_count); + if (out2!=GSUB_E_NOGLYPH) + out_index = out2; + } return out_index; }