*** empty log message ***
[m17n/m17n-lib.git] / src / m17n-flt.c
index c0ae65b..e082fe3 100644 (file)
@@ -1,5 +1,5 @@
 /* m17n-flt.c -- Font Layout Table sub-module.
-   Copyright (C) 2003, 2004, 2007, 2008, 2009
+   Copyright (C) 2003, 2004, 2007, 2008, 2009, 2010
      National Institute of Advanced Industrial Science and Technology (AIST)
      Registration Number H15PRO112
 
@@ -257,9 +257,9 @@ enum GlyphInfoMask
 {
   CategoryCodeMask = 0x7F,
   CombiningCodeMask = 0xFFFFFF,
-  CombinedMask = 1 << 27,
-  LeftPaddingMask = 1 << 28,
-  RightPaddingMask = 1 << 29
+  CombinedMask = 1 << 28,
+  LeftPaddingMask = 1 << 29,
+  RightPaddingMask = 1 << 30
 };
 
 #define SET_GLYPH_INFO(g, mask, ctx, info)                     \
@@ -1875,6 +1875,8 @@ decode_packed_otf_tag (FontLayoutContext *ctx, MFLTGlyphString *gstring,
       unsigned int tag = g->internal & 0xFFFFFFF;
       char enc;
 
+      if (GET_COMBINED (g))
+       continue;
       if (! category)
        {
          SET_CATEGORY_CODE (g, 0);
@@ -2016,7 +2018,6 @@ try_otf (int depth, MFLTOtfSpec *otf_spec, int from, int to,
         FontLayoutContext *ctx)
 {
   MFLTFont *font = ctx->font;
-  int from_idx = ctx->out->used;
 
   if (MDEBUG_FLAG () > 2)
     MDEBUG_PRINT3 ("\n [FLT] %*s%s", depth, "", MSYMBOL_NAME (otf_spec->sym));
@@ -2052,9 +2053,6 @@ try_otf (int depth, MFLTOtfSpec *otf_spec, int from, int to,
   font->get_glyph_id (font, ctx->in, from, to);
   if (mflt_try_otf)
     {
-      int out_len;
-      int i;
-
       to = mflt_try_otf (font, otf_spec, ctx->in, from, to);
       if (to < 0)
        return from;
@@ -2311,11 +2309,15 @@ run_stages (MFLTGlyphString *gstring, int from, int to,
 
          if (GET_COMBINED (g)
              || (prev_category && prev_category != ctx->stage->category))
-           enc = (GET_ENCODED (g)
-                  ? (g->c > 0 ? (int) mchartable_lookup (table, g->c) : 1)
-                  : g->code
-                  ? (int) mchartable_lookup (table, g->code)
-                  : ' ');
+           {
+             enc = (GET_ENCODED (g)
+                    ? (g->c > 0 ? (int) mchartable_lookup (table, g->c) : 1)
+                    : g->code
+                    ? (int) mchartable_lookup (table, g->code)
+                    : ' ');
+             if (! GET_COMBINED (g))
+               SET_CATEGORY_CODE (g, enc);
+           }
          else
            enc = GET_CATEGORY_CODE (g);
          ctx->encoded[i - from] = enc;