#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), \
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)
{
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;