(enum GlyphInfoMask): Shift upper masks 1-bit left.
[m17n/m17n-lib.git] / src / m17n-flt.c
index c0ae65b..65970d4 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);
@@ -2311,11 +2313,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;