From: handa Date: Sat, 24 Jul 2004 02:44:48 +0000 (+0000) Subject: (gstring_subst): Set `c' and `f.index' of X-Git-Tag: REL-0-9-1~38 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=0223839d5bca33f6cb33e35094fac393fbf0a570;p=m17n%2Flibotf.git (gstring_subst): Set `c' and `f.index' of OTF_Glyph. (OTF_drive_gsub): Iniialize f.index member of OTF_Glhph. --- diff --git a/src/otfdrive.c b/src/otfdrive.c index 59b8114..20eef30 100644 --- a/src/otfdrive.c +++ b/src/otfdrive.c @@ -62,13 +62,21 @@ gstring_subst (OTF_GlyphString *gstring, int from, int to, int errret = -1; int len = to - from; int i; + int c = gstring->glyphs[from].c; + int from_idx = gstring->glyphs[from].f.index.from; + int to_idx = gstring->glyphs[to - 1].f.index.to; if (len < num) GSTRING_INSERT (gstring, from, (num - len)); else if (len > num) GSTRING_DELETE (gstring, from, (len - num)); for (i = 0; i < num; i++) - gstring->glyphs[from + i].glyph_id = ids[i]; + { + gstring->glyphs[from + i].c = c; + gstring->glyphs[from + i].glyph_id = ids[i]; + gstring->glyphs[from + i].f.index.from = from_idx; + gstring->glyphs[from + i].f.index.to = to_idx; + } return 0; } @@ -1160,6 +1168,9 @@ OTF_drive_gsub (OTF *otf, OTF_GlyphString *gstring, if (n < 0) return errret; + for (i = 0; i < gstring->used; i++) + gstring->glyphs[i].f.index.from = gstring->glyphs[i].f.index.to = i; + for (i = 0; i < n; i++) { int index = lookup_indices[i];