X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fmodules%2Fswfalignzones.c;h=19619036c8da726fb4f0ca365ffb760879933c88;hb=d040bee21c66541e231a68fea4936328e4ce4c39;hp=d58cea2197fb06033355911af56dcd4aefbb84d7;hpb=e584fab17969f34332c92f7bf67ca2926668e197;p=swftools.git diff --git a/lib/modules/swfalignzones.c b/lib/modules/swfalignzones.c index d58cea2..1961903 100644 --- a/lib/modules/swfalignzones.c +++ b/lib/modules/swfalignzones.c @@ -60,6 +60,7 @@ static void find_best(float*_row, int width, int*_x1, int*_x2, int min_size, int } row[t] = sum; } + free(filter); for(t=from;t<=to;t++) { if(row[t]>max1) { @@ -72,6 +73,14 @@ static void find_best(float*_row, int width, int*_x1, int*_x2, int min_size, int if(num<=1) { *_x1=x1; } else { + /* this code is slightly wrong, in that it assumes that the glyph distortion problem + gets worse when the font sizes get smaller. it doesn't. in fact, the smaller + the font size, the more of the scaling bugs disappear (http://www.quiss.org/files/scaletest.swf) + A better way would probably to use the font size you need for the two alignzones + to come to lie in different pixels, which what I think is what makes the problems + appear/disappear. + */ + double scale = min_size/1024.0; for(t=from;t<=to;t++) { if(t==x1) { @@ -107,7 +116,6 @@ static void find_best(float*_row, int width, int*_x1, int*_x2, int min_size, int *_x2=x2; } - free(row); } @@ -192,7 +200,7 @@ void swf_FontCreateAlignZones(SWFFONT * f) f->alignzones = (ALIGNZONE*)rfx_calloc(sizeof(ALIGNZONE)*f->numchars); f->alignzone_flags = FONTALIGN_MEDIUM; - if(!f->layout) { + if(!f->layout || !f->use) { int t; for(t=0;tnumchars;t++) { // just align the baseline @@ -231,6 +239,9 @@ void swf_FontCreateAlignZones(SWFFONT * f) negate_y(&b); f->alignzones[t] = detect_for_char(f, t, row, column, bounds, b); } + free(row); + free(column_global); + free(column); } }