From fa51bfcf13569cf58eef4365c0e47723ff69df26 Mon Sep 17 00:00:00 2001 From: handa Date: Tue, 6 Nov 2007 07:25:21 +0000 Subject: [PATCH] (run_rule): Don't set error code here. (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 | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/m17n-flt.c b/src/m17n-flt.c index d5950fa..e850382 100644 --- a/src/m17n-flt.c +++ b/src/m17n-flt.c @@ -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; -- 1.7.10.4