(lookup_gpos): Fix handling of flag.
authorhanda <handa>
Thu, 5 Aug 2004 06:44:32 +0000 (06:44 +0000)
committerhanda <handa>
Thu, 5 Aug 2004 06:44:32 +0000 (06:44 +0000)
src/otfdrive.c

index 7d3a71a..c8138ac 100644 (file)
@@ -864,7 +864,8 @@ lookup_gpos (OTF_LookupList *lookup_list, unsigned lookup_list_index,
 
              while (baseg >= gstring->glyphs
                     && (! baseg->glyph_id
-                        || ! (flag & (1 << baseg->GlyphClass))))
+                        || (baseg->GlyphClass
+                            && (flag & (1 << baseg->GlyphClass)))))
                baseg--;
              coverage_idx_base
                = get_coverage_index (&mark_base1->BaseCoverage,
@@ -902,7 +903,8 @@ lookup_gpos (OTF_LookupList *lookup_list, unsigned lookup_list_index,
 
              while (ligg >= gstring->glyphs
                     && (! ligg->glyph_id
-                        || ! (flag & (1 << ligg->GlyphClass))))
+                        || (ligg->GlyphClass
+                            && (flag & (1 << ligg->GlyphClass)))))
                {
                  if (ligg->positioning_type == 5
                      && ligg->MarkAttachClass < mark_lig1->ClassCount)
@@ -920,7 +922,8 @@ lookup_gpos (OTF_LookupList *lookup_list, unsigned lookup_list_index,
                        + coverage_idx_lig);
              for (j = 0; j < attach->ComponentCount; j++)
                {
-                 OTF_Anchor *lig_anchor = attach->ComponentRecord + j;
+                 OTF_Anchor *lig_anchor
+                   = attach->ComponentRecord[j].LigatureAnchor;
 
                  if (lig_anchor[mark_record->Class].AnchorFormat
                      && num_class[mark_record->Class]-- < 0)
@@ -947,7 +950,8 @@ lookup_gpos (OTF_LookupList *lookup_list, unsigned lookup_list_index,
 
              while (prevg >= gstring->glyphs
                     && (! prevg->glyph_id
-                        || ! (flag & (1 << prevg->GlyphClass))))
+                        || (prevg->GlyphClass
+                            && (flag & (1 << prevg->GlyphClass)))))
                prevg--;
              if (prevg < gstring->glyphs)
                continue;