(run_stages): Fix handling of padding.
authorhanda <handa>
Fri, 17 Aug 2007 07:32:10 +0000 (07:32 +0000)
committerhanda <handa>
Fri, 17 Aug 2007 07:32:10 +0000 (07:32 +0000)
src/m17n-flt.c

index bdc1d9e..7f16cf3 100644 (file)
@@ -1893,19 +1893,16 @@ run_stages (MFLTGlyphString *gstring, int from, int to,
            g = GREF (ctx->out, i);
            if (! GET_COMBINING_CODE (g))
              {
-               if (GET_LEFT_PADDING (g) && g->lbearing < 0)
+               if (GET_RIGHT_PADDING (g) && g->rbearing > g->xadv)
                  {
-                   g->xoff -= g->lbearing;
-                   if (g->rbearing < 0)
-                     g->xadv = g->rbearing - g->lbearing;
-                   else
-                     g->xadv += g->xoff;
-                   g->rbearing += g->xoff;
-                   g->lbearing = 0;
+                   g->xadv = g->rbearing;
                  }
-               if (i > 0 && GET_RIGHT_PADDING (g) && g->rbearing > g->xadv)
+               if (GET_LEFT_PADDING (g) && g->lbearing < 0)
                  {
-                   g->xadv = g->rbearing;
+                   g->xoff += - g->lbearing;
+                   g->xadv += - g->lbearing;
+                   g->rbearing += - g->lbearing;
+                   g->lbearing = 0;
                  }
              }
          }