X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=lib%2Ffilters%2Fremove_font_transforms.c;h=afcc62f39d1ba7719c7ab5daa2db8f068625aa0e;hp=16d02add7576cf18e89786e49ae7a307d7f66d49;hb=6b420806fea03cbd86d5a6d55b112010b15cbba3;hpb=b9f1e7011f2ad4be624ab777a5091623a807b3d9 diff --git a/lib/filters/remove_font_transforms.c b/lib/filters/remove_font_transforms.c index 16d02ad..afcc62f 100644 --- a/lib/filters/remove_font_transforms.c +++ b/lib/filters/remove_font_transforms.c @@ -166,6 +166,8 @@ static void glyph_transform(gfxglyph_t*g, mymatrix_t*mm) m.ty = 0; g->line = gfxline_clone(g->line); gfxline_transform(g->line, &m); + if(m.m00>0) + g->advance *= m.m00; } static gfxresult_t* pass1_finish(gfxfilter_t*f, gfxdevice_t*out) @@ -203,8 +205,6 @@ static gfxresult_t* pass1_finish(gfxfilter_t*f, gfxdevice_t*out) gfxline_t*line = font->glyphs[t].line; gfxbbox_t b = gfxline_getbbox(line); total = gfxbbox_expand_to_bbox(total, b); - if(b.xmax > 0) - font->glyphs[t].advance = b.xmax; } if(count) average_xmax /= count; @@ -212,11 +212,8 @@ static gfxresult_t* pass1_finish(gfxfilter_t*f, gfxdevice_t*out) fd->dx = -total.xmin; fd->dy = 0; - double adx = fd->dx>0?fd->dx:0; - for(t=0;tglyphs[t].line; - font->glyphs[t].advance += adx; while(line) { line->x += fd->dx; line->y += fd->dy; @@ -230,6 +227,12 @@ static gfxresult_t* pass1_finish(gfxfilter_t*f, gfxdevice_t*out) return out->finish(out); } +static void pass2_addfont(gfxfilter_t*f, gfxfont_t*font, gfxdevice_t*out) +{ + /* we throw away original fonts, and do the addfont() for the transformed + fonts in the first drawchar() */ +} + static void pass2_drawchar(gfxfilter_t*f, gfxfont_t*font, int glyphnr, gfxcolor_t*color, gfxmatrix_t*matrix, gfxdevice_t*out) { internal_t*i = (internal_t*)f->internal;