#define UPDATE_CLUSTER_RANGE(ctx, g) \
do { \
- if ((ctx)->cluster_begin_idx) \
+ if ((ctx)->cluster_begin_idx >= 0) \
{ \
if (ctx->cluster_begin_pos > (g)->from) \
ctx->cluster_begin_pos = (g)->from; \
}
}
- if (ctx->cluster_begin_idx)
+ if (ctx->cluster_begin_idx >= 0)
for (; from_idx < ctx->out->used; from_idx++)
{
MFLTGlyph *g = GREF (ctx->out, from_idx);
SET_LEFT_PADDING (g, ctx, LeftPaddingMask);
UPDATE_CLUSTER_RANGE (ctx, g);
if (MDEBUG_FLAG () > 2)
- MDEBUG_PRINT3 ("\n [FLT] %*s(COPY 0x%X)", depth, "", g->code);
+ {
+ if (g->c < 0)
+ MDEBUG_PRINT2 ("\n [FLT] %*s(COPY |)", depth, "");
+ else
+ MDEBUG_PRINT3 ("\n [FLT] %*s(COPY 0x%X)", depth, "", g->code);
+ }
ctx->code_offset = ctx->combining_code = ctx->left_padding = 0;
return (from + 1);
}
case CMD_ID_CLUSTER_BEGIN:
- if (! ctx->cluster_begin_idx)
+ if (ctx->cluster_begin_idx < 0)
{
if (MDEBUG_FLAG () > 2)
MDEBUG_PRINT3 ("\n [FLT] %*s<%d", depth, "",
return from;
case CMD_ID_CLUSTER_END:
- if (ctx->cluster_begin_idx && ctx->cluster_begin_idx < ctx->out->used)
+ if (ctx->cluster_begin_idx >= 0
+ && ctx->cluster_begin_idx < ctx->out->used)
{
int i;
if (MDEBUG_FLAG () > 2)
- MDEBUG_PRINT1 (" %d>", ctx->cluster_end_pos);
+ MDEBUG_PRINT1 (" %d>", ctx->cluster_end_pos + 1);
for (i = ctx->cluster_begin_idx; i < ctx->out->used; i++)
{
GREF (ctx->out, i)->from = ctx->cluster_begin_pos;
GREF (ctx->out, i)->to = ctx->cluster_end_pos;
}
- ctx->cluster_begin_idx = 0;
+ ctx->cluster_begin_idx = -1;
}
return from;
/* Setup CTX. */
memset (&ctx, 0, sizeof ctx);
+ ctx.cluster_begin_idx = -1;
/* Find previous glyphs that are also supported by the layouter. */
for (i = from;
i > 0 && (g = GREF (gstring, i - 1))