(gstring_subst): If a glyph is changed, set the
authorhanda <handa>
Thu, 20 Dec 2007 03:51:07 +0000 (03:51 +0000)
committerhanda <handa>
Thu, 20 Dec 2007 03:51:07 +0000 (03:51 +0000)
character code to 0, and update GlyphClass.

src/otfdrive.c

index 794438d..3dc6eda 100644 (file)
@@ -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.  */