(run_rule): Don't set error code here.
authorhanda <handa>
Tue, 6 Nov 2007 07:25:21 +0000 (07:25 +0000)
committerhanda <handa>
Tue, 6 Nov 2007 07:25:21 +0000 (07:25 +0000)
(run_cond): Likewise.
(run_otf): Fix culculation of xoff and yoff.
(run_command): Don't set error code here.
(PREV): New macro.
(NEXT): New macro.

src/m17n-flt.c

index d5950fa..e850382 100644 (file)
@@ -287,6 +287,12 @@ enum GlyphInfoMask
 #define GREF(gstring, idx)     \
   ((MFLTGlyph *) ((char *) ((gstring)->glyphs) + (gstring)->glyph_size * (idx)))
 
+#define PREV(gstring, g)       \
+  ((MFLTGlyph *) ((char *) (g) - (gstring)->glyph_size))
+
+#define NEXT(gstring, g)       \
+  ((MFLTGlyph *) ((char *) (g) + (gstring)->glyph_size))
+
 #define GCPY(src, src_idx, n, tgt, tgt_idx)                            \
   do {                                                                 \
     memcpy ((char *) ((tgt)->glyphs) + (tgt)->glyph_size * (tgt_idx),  \
@@ -1599,17 +1605,17 @@ run_otf (int depth,
       if (otf_spec->features[1])
        {
          MFLTGlyphAdjustment *a;
-
+         MFLTGlyph *g;
+         
          for (i = 0, a = adjustment; i < out_len; i++, a++)
            if (a->set)
              break;
          if (i < out_len)
            {
              font->get_metrics (font, ctx->out, from_idx, ctx->out->used);
-             for (i = 0, a = adjustment; i < out_len; i++, a++)
+             for (i = 0, g = GREF (ctx->out, from_idx + i), a = adjustment;
+                  i < out_len; i++, a++, g = NEXT (ctx->out, g))
                {
-                 MFLTGlyph *g = GREF (ctx->out, from_idx + i);
-
                  SET_MEASURED (g, 1);
                  if (a->advance_is_absolute)
                    {
@@ -1624,14 +1630,15 @@ run_otf (int depth,
                  if (a->xoff || a->yoff)
                    {
                      int j;
-                     MFLTGlyph *gg = g;
+                     MFLTGlyph *gg = PREV (ctx->out, g);
                      MFLTGlyphAdjustment *aa = a;
 
                      g->xoff = a->xoff;
                      g->yoff = a->yoff;
                      while (aa->back > 0)
                        {
-                         for (j = 0, gg--; j < aa->back; j++, gg--)
+                         for (j = 0; j < aa->back;
+                              j++, gg = PREV (ctx->out, gg))
                            g->xoff -= gg->xadv;
                          aa = aa - aa->back;
                          g->xoff += aa->xoff;