From: handa Date: Mon, 6 Aug 2007 11:13:06 +0000 (+0000) Subject: (gstring_subst): If otf->cmap is NULL, set X-Git-Tag: REL-0-9-7~11 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4603ea0b5632b8dad34a193fd6a98e3d8684fe71;p=m17n%2Flibotf.git (gstring_subst): If otf->cmap is NULL, set character code of a glyph to 0. (OTF_drive_gsub): If otf->cmap is NULL, try to load it. --- diff --git a/src/otfdrive.c b/src/otfdrive.c index 44ec9e5..a822704 100644 --- a/src/otfdrive.c +++ b/src/otfdrive.c @@ -102,7 +102,10 @@ 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++) { - gstring->glyphs[from + i].c = otf->cmap->decode_table[ids[i]]; + if (otf->cmap) + gstring->glyphs[from + i].c = otf->cmap->decode_table[ids[i]]; + else + gstring->glyphs[from + i].c = 0; gstring->glyphs[from + i].glyph_id = ids[i]; if (otf->gdef) gstring->glyphs[from + i].GlyphClass @@ -1426,6 +1429,8 @@ int OTF_drive_gsub (OTF *otf, OTF_GlyphString *gstring, const char *script, const char *language, const char *features) { + if (! otf->cmap) + OTF_get_table (otf, "cmap"); return OTF_drive_gsub_internal (otf, gstring, script, language, features, 0); }