(gstring_subst): Setup all members of struct
authorhanda <handa>
Tue, 25 Jul 2006 01:02:20 +0000 (01:02 +0000)
committerhanda <handa>
Tue, 25 Jul 2006 01:02:20 +0000 (01:02 +0000)
OTF_Glyph.
(lookup_gsub): Call gstring_subst with correct args.

src/otfdrive.c

index 1263164..987c649 100644 (file)
@@ -65,6 +65,8 @@ write to the Free Software Foundation, Inc., 59 Temple Place, Suite
   } while (0)
 
 
+static unsigned get_class_def (OTF_ClassDef *, OTF_GlyphID);
+
 static int
 gstring_subst (OTF *otf, OTF_GlyphString *gstring, int from, int to, int flag,
               OTF_GlyphID *ids, int num)
@@ -99,6 +101,12 @@ gstring_subst (OTF *otf, OTF_GlyphString *gstring, int from, int to, int flag,
     {
       gstring->glyphs[from + i].c = otf->cmap->decode_table[ids[i]];
       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;
     }
@@ -473,7 +481,7 @@ lookup_gsub (OTF *otf, OTF_LookupList *lookup_list, unsigned lookup_list_index,
              OTF_GSUB_Alternate1 *alt1 = &subtable->u.alternate1;
              OTF_AlternateSet *altset = alt1->AlternateSet + coverage_idx;
 
-             gstring_subst (otf, gstring, gidx + 1, gidx + 1, flag,
+             gstring_subst (otf, gstring, gidx, gidx + 1, flag,
                             altset->Alternate, altset->GlyphCount);
              gidx += altset->GlyphCount;;
            }