always preserve space char in filters
[swftools.git] / lib / filters / remove_font_transforms.c
index 748ba22..84a873c 100644 (file)
@@ -99,7 +99,7 @@ void matrix_convert(gfxmatrix_t*in, const char*id, mymatrix_t*out, gfxmatrix_t*s
 {
     double l1 = sqrt(in->m00 * in->m00 + in->m01 * in->m01);
     double l2 = sqrt(in->m10 * in->m10 + in->m11 * in->m11);
-    double l = l1+l2;
+    double l = (l1+l2)/2.0;
     if(l < 1e-10) {
        memset(out, 0, sizeof(*out));
        return;
@@ -138,6 +138,11 @@ static transformedfont_t* transformedfont_new(gfxfont_t*orig, mymatrix_t*m)
     f->orig = orig;
     f->matrix = *m;
     f->used = malloc(sizeof(f->used[0])*orig->num_glyphs);
+    int t;
+    for(t=0;t<orig->num_glyphs;t++) {
+       if(orig->glyphs[t].unicode==32)
+           f->used[t]=1; //always preserve the space char in fonts
+    }
     return f;
 }