X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fdevices%2Fswf.c;h=1db6b384615bbd2d146147b5502ea0d463a4d9c9;hb=5c25a1fc058ae69818976cbb0e6c6b2f6a1aada5;hp=3277938986b2776fc73a65e68e01d36ff5936103;hpb=4e514da68a127743aaa789f00145037f04179306;p=swftools.git diff --git a/lib/devices/swf.c b/lib/devices/swf.c index 3277938..1db6b38 100644 --- a/lib/devices/swf.c +++ b/lib/devices/swf.c @@ -114,6 +114,7 @@ typedef struct _swfoutput_internal int config_bboxvars; int config_disable_polygon_conversion; int config_normalize_polygon_positions; + int config_alignfonts; char config_disablelinks; RGBA config_linkcolor; float config_minlinewidth; @@ -623,6 +624,7 @@ static void chararray_writetotag(chararray_t*_chardata, TAG*tag) int lastx; int lasty; int lastsize; + int lastchar; int charids[128]; int charadvance[128]; int charstorepos; @@ -646,6 +648,7 @@ static void chararray_writetotag(chararray_t*_chardata, TAG*tag) lastx = CHARMIDX; lasty = CHARMIDY; lastsize = -1; + lastchar = -1; if(pass==1) { @@ -670,9 +673,9 @@ static void chararray_writetotag(chararray_t*_chardata, TAG*tag) charatposition_t*chr = &chardata->chr[t]; - if(lastfont != chardata->chr[t].font || - lastx!=chardata->chr[t].x || - lasty!=chardata->chr[t].y || + if(lastfont != chr->font || + lastx!=chr->x || + lasty!=chr->y || !colorcompare(&color, &chardata->chr[t].color) || charstorepos==127 || lastsize != chardata->chr[t].size || @@ -745,7 +748,7 @@ static void chararray_writetotag(chararray_t*_chardata, TAG*tag) if(tpos-1) nextx = chardata->chr[t+1].x; if(t==chardata->pos-1 && chardata->next) nextx = chardata->next->chr[0].x; int dx = nextx-chr->x; - + int advance; if(dx>=0 && (dx<(1<<(advancebits-1)) || pass==0)) { advance = dx; @@ -754,8 +757,10 @@ static void chararray_writetotag(chararray_t*_chardata, TAG*tag) advance = 0; lastx=chr->x; } + charids[charstorepos] = chr->charid; charadvance[charstorepos] = advance; + lastchar = chr->charid; charstorepos ++; } chardata = chardata->next; @@ -1466,10 +1471,11 @@ void swfoutput_finalize(gfxdevice_t*dev) endpage(dev); fontlist_t *iterator = i->fontlist; char use_font3 = i->config_flashversion>=8 && !NO_FONT3; + while(iterator) { TAG*mtag = i->swf->firstTag; if(iterator->swffont) { - if(use_font3) { + if(use_font3 && i->config_alignfonts) { // needs to be done before the reduce swf_FontCreateAlignZones(iterator->swffont); } @@ -1485,19 +1491,19 @@ void swfoutput_finalize(gfxdevice_t*dev) } else { mtag = swf_InsertTag(mtag, ST_DEFINEFONT3); swf_FontSetDefine2(mtag, iterator->swffont); - if(iterator->swffont->alignzones) { - mtag = swf_InsertTag(mtag, ST_DEFINEFONTALIGNZONES); - swf_FontSetAlignZones(mtag, iterator->swffont); - } } } } iterator = iterator->next; } - + i->tag = swf_InsertTag(i->tag,ST_END); TAG* tag = i->tag->prev; + + if(i->config_storeallcharacters) { + swf_FontPostprocess(i->swf); // generate alignment information + } /* remove the removeobject2 tags between the last ST_SHOWFRAME and the ST_END- they confuse the flash player */