From 9a8e8449228ee0a12a060715667900c2b8b1fd0b Mon Sep 17 00:00:00 2001 From: handa Date: Thu, 20 Dec 2007 03:51:07 +0000 Subject: [PATCH] (gstring_subst): If a glyph is changed, set the character code to 0, and update GlyphClass. --- src/otfdrive.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/otfdrive.c b/src/otfdrive.c index 794438d..3dc6eda 100644 --- a/src/otfdrive.c +++ b/src/otfdrive.c @@ -102,16 +102,16 @@ gstring_subst (OTF *otf, OTF_GlyphString *gstring, int from, int to, int flag, GSTRING_DELETE (gstring, from, (len - num)); for (i = 0; i < num; i++) { - if (otf->cmap) - gstring->glyphs[from + i].c = otf->cmap->decode_table[ids[i]]; - else - gstring->glyphs[from + i].c = 0; + if (gstring->glyphs[from + i].glyph_id != ids[i]) + { + gstring->glyphs[from + i].c = 0; + if (otf->gdef) + gstring->glyphs[from + i].GlyphClass + = get_class_def (&otf->gdef->glyph_class_def, ids[i]); + else + gstring->glyphs[from + i].GlyphClass = 0; + } gstring->glyphs[from + i].glyph_id = ids[i]; - if (otf->gdef) - gstring->glyphs[from + i].GlyphClass - = get_class_def (&otf->gdef->glyph_class_def, ids[i]); - else - gstring->glyphs[from + i].GlyphClass = 0; gstring->glyphs[from + i].positioning_type = 0; gstring->glyphs[from + i].f.index.from = from_idx; gstring->glyphs[from + i].f.index.to = to_idx; @@ -763,7 +763,7 @@ lookup_gpos (OTF_LookupList *lookup_list, unsigned lookup_list_index, int i; if (IGNORED_GLYPH (g, flag) - || g->positioning_type) + || (0 & g->positioning_type)) return (gidx + 1); /* Try all subtables until one of them handles the current glyph. */ -- 1.7.10.4