fixed lsb issue
authorMatthias Kramm <kramm@quiss.org>
Tue, 13 Apr 2010 23:50:37 +0000 (16:50 -0700)
committerMatthias Kramm <kramm@quiss.org>
Tue, 13 Apr 2010 23:53:15 +0000 (16:53 -0700)
lib/filters/remove_font_transforms.c
lib/gfxfont.c

index 9133569..c04d110 100644 (file)
@@ -226,7 +226,7 @@ static gfxresult_t* pass1_finish(gfxfilter_t*f, gfxdevice_t*out)
        if(count) 
            average_xmax /= count;
 
-       fd->dx = -total.xmin;
+       fd->dx = 0;//-total.xmin;
 
        font->ascent = total.ymax;
        font->descent = -total.ymin;
index acc8e34..7c71ca7 100644 (file)
@@ -665,7 +665,19 @@ ttf_t* gfxfont_to_ttf(gfxfont_t*font)
            }
        }
 
+       /* make sure coordinates are always to the right of the origin */
+       int xshift=0;
+       if(dest->xmin < 0) {
+           xshift = -dest->xmin;
+           for(s=0;s<count;s++) {
+               dest->points[s].x += xshift;
+           }
+           dest->xmin += xshift;
+           dest->xmax += xshift;
+       }
+
        dest->bearing = dest->xmin;
+       dest->xmin=0;
        dest->advance = src->advance*scale;
 
        int u = font->glyphs[t].unicode;