{
CombiningCodeMask = 0xFFFFFFF,
LeftPaddingMask = 1 << 28,
- RightPaddingMask = 1 << 29,
- EncodedMask = 1 << 30,
- PositionedMask = 1 << 31
+ RightPaddingMask = 1 << 29
};
#define SET_GLYPH_INFO(g, mask, ctx, info) \
#define GET_RIGHT_PADDING(g) ((g)->internal & RightPaddingMask)
#define SET_RIGHT_PADDING(g, ctx, flag) \
SET_GLYPH_INFO (g, RightPaddingMask, ctx, flag)
-#define GET_ENCODED(g) ((g)->internal & EncodedMask)
-#define SET_ENCODED(g, ctx, flag) \
- SET_GLYPH_INFO (g, EncodedMask, ctx, flag)
-#define GET_POSITIONED(g) ((g)->internal & PositionedMask)
-#define SET_POSITIONED(g, ctx, flag) \
- SET_GLYPH_INFO (g, PositionedMask, ctx, flag)
+#define GET_ENCODED(g) ((g)->encoded)
+#define SET_ENCODED(g, flag) ((g)->encoded = (flag))
+#define GET_MEASURED(g) ((g)->measured)
+#define SET_MEASURED(g, flag) ((g)->measured = (flag))
#define GINIT(gstring, n) \
do { \
#define GREF(gstring, idx) \
((MFLTGlyph *) ((char *) ((gstring)->glyphs) + (gstring)->glyph_size * (idx)))
-#define GAPPEND(gstring, g) \
- do { \
- if ((gstring)->allocated <= (gstring)->used) \
- return -2; \
- memcpy ((char *) (((gstring)->glyphs) \
- + (gstring)->glyph_size * (gstring)->used), \
- (char *) g, (gstring)->glyph_size); \
- } while (0)
-
#define GDUP(ctx, idx) \
do { \
MFLTGlyphString *src = ctx->in; \
if (MDEBUG_FLAG () > 2)
MDEBUG_PRINT3 ("\n [FLT] %*s%s", depth, "", MSYMBOL_NAME (otf_spec->sym));
- for (i = from; i < to; i++)
- {
- MFLTGlyph *g = GREF (ctx->in, i);
- if (! (GET_ENCODED (g)))
- {
- font->get_glyph_id (font, g);
- SET_ENCODED (g, ctx, EncodedMask);
- }
- }
+ font->get_glyph_id (font, ctx->in, from, to);
adjustment = alloca ((sizeof *adjustment)
* (ctx->out->allocated - ctx->out->used));
if (! adjustment)
{
MFLTGlyph *g = GREF (ctx->out, from_idx + i);
- SET_POSITIONED (g, ctx, PositionedMask);
+ SET_MEASURED (g, 1);
if (a->xadv || a->yadv)
{
if (a->advance_is_absolute)
GDUP (ctx, i);
g = GREF (ctx->out, ctx->out->used - 1);
g->code = ctx->code_offset + id;
+ SET_ENCODED (g, 0);
+ SET_MEASURED (g, 0);
if (ctx->combining_code)
SET_COMBINING_CODE (g, ctx, ctx->combining_code);
if (ctx->left_padding)
g = GREF (ctx->out, ctx->out->used - 1);
g->c = -1, g->code = 0;
g->xadv = g->yadv = 0;
- SET_ENCODED (g, ctx, 0);
+ SET_ENCODED (g, 0);
+ SET_MEASURED (g, 0);
return from;
}
MERROR (MERROR_DRAW, -1);
}
-static void
-positioning (MFLTFont *font, MFLTGlyphString *gstring, int from, int to)
-{
- int i, j;
-
- for (i = j = from; i < to; i++)
- {
- MFLTGlyph *g = GREF (gstring, i);
-
- if (GET_POSITIONED (g))
- {
- if (j < i)
- font->get_metric (font, gstring, j, i);
- j = i + 1;
- }
- }
- if (j < i)
- font->get_metric (font, gstring, j, i);
-}
-
static int
run_stages (MFLTGlyphString *gstring, int from, int to,
MFLT *flt, FontLayoutContext *ctx)
}
/* Get actual glyph IDs of glyphs. */
- for (i = 0; i < ctx->out->used; i++)
- {
- g = GREF (ctx->out, i);
- if (! GET_ENCODED (g))
- ctx->font->get_glyph_id (ctx->font, g);
- }
+ ctx->font->get_glyph_id (ctx->font, ctx->out, 0, ctx->out->used);
/* Check if all characters in the range are covered by some
glyph(s). If not, change <from> and <to> of glyphs to cover
}
}
- if (ctx->font->get_metric)
- positioning (ctx->font, ctx->out, 0, ctx->out->used);
+ ctx->font->get_metric (ctx->font, ctx->out, 0, ctx->out->used);
/* Handle combining. */
if (ctx->check_mask & CombiningCodeMask)