From 4ae015fc640305e903859fac5bd7249f9e700371 Mon Sep 17 00:00:00 2001 From: handa Date: Thu, 3 Dec 2009 08:08:56 +0000 Subject: [PATCH] (decode_packed_otf_tag): Re-calculate category code only if some feature is applied. --- src/m17n-flt.c | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/src/m17n-flt.c b/src/m17n-flt.c index 0e54af1..891b69f 100644 --- a/src/m17n-flt.c +++ b/src/m17n-flt.c @@ -1861,7 +1861,8 @@ decode_packed_otf_tag (FontLayoutContext *ctx, MFLTGlyphString *gstring, { int i; - g->internal &= 0x30000000; + /* Clear the feature tag code. */ + g->internal &= ~0xFFFFFFF; for (i = 0, enc = '\0'; i < category->feature_table.size; i++) if (category->feature_table.tag[i] == tag) { @@ -1870,12 +1871,11 @@ decode_packed_otf_tag (FontLayoutContext *ctx, MFLTGlyphString *gstring, ctx->encoded[from - ctx->encoded_offset] = enc; break; } + if (! enc) + enc = (g->c > 0 ? (int) mchartable_lookup (category->table, g->c) + : 1); + SET_CATEGORY_CODE (g, enc); } - else - enc = '\0'; - if (! enc) - enc = g->c > 0 ? (int) mchartable_lookup (category->table, g->c) : 1; - SET_CATEGORY_CODE (g, enc); } } @@ -2138,19 +2138,6 @@ run_command (int depth, int id, int from, int to, FontLayoutContext *ctx) g = GREF (ctx->out, ctx->out->used - 1); if (ctx->combining_code) SET_COMBINING_CODE (g, ctx, ctx->combining_code); -#if 0 - else if (! GET_COMBINED (g) && ctx->category) - { - MCharTable *table = ctx->category->table; - char enc = (GET_ENCODED (g) - ? (g->c > 0 ? (int) mchartable_lookup (table, g->c) - : 1) - : g->code - ? (int) mchartable_lookup (table, g->code) - : ' '); - SET_CATEGORY_CODE (g, enc); - } -#endif if (ctx->left_padding) SET_LEFT_PADDING (g, ctx, LeftPaddingMask); if (ctx->cluster_begin_idx >= 0) -- 1.7.10.4