From: handa Date: Thu, 20 Dec 2007 03:51:07 +0000 (+0000) Subject: (gstring_subst): If a glyph is changed, set the X-Git-Tag: REL-0-9-7~3 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=9a8e8449228ee0a12a060715667900c2b8b1fd0b;p=m17n%2Flibotf.git (gstring_subst): If a glyph is changed, set the character code to 0, and update GlyphClass. --- 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. */