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;
int lastx;
int lasty;
int lastsize;
+ int lastchar;
int charids[128];
int charadvance[128];
int charstorepos;
lastx = CHARMIDX;
lasty = CHARMIDY;
lastsize = -1;
+ lastchar = -1;
if(pass==1)
{
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 ||
lastx = chr->x;
lasty = chr->y;
lastsize = chr->size;
+ } else {
+ assert(lastchar>=0);
+ if(pass==1 && lastchar!=chr->charid) {
+ swf_FontUsePair(chr->font, lastchar, chr->charid);
+ swf_FontUsePair(chr->font, chr->charid, lastchar);
+ }
}
if(islast)
if(t<chardata->pos-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;
advance = 0;
lastx=chr->x;
}
+
charids[charstorepos] = chr->charid;
charadvance[charstorepos] = advance;
+ lastchar = chr->charid;
charstorepos ++;
}
chardata = chardata->next;
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 && i->config_alignfonts) {
+ // needs to be done before the reduce
+ swf_FontCreateAlignZones(iterator->swffont);
+ }
if(!i->config_storeallcharacters) {
msg("<debug> Reducing font %s", iterator->swffont->name);
swf_FontReduce(iterator->swffont);
}
int used = iterator->swffont->use && iterator->swffont->use->used_glyphs;
if(used) {
- if(i->config_flashversion<8 || NO_FONT3) {
+ if(!use_font3) {
mtag = swf_InsertTag(mtag, ST_DEFINEFONT2);
swf_FontSetDefine2(mtag, iterator->swffont);
} else {
mtag = swf_InsertTag(mtag, ST_DEFINEFONT3);
swf_FontSetDefine2(mtag, iterator->swffont);
-
- swf_FontCreateAlignZones(iterator->swffont);
-
if(iterator->swffont->alignzones) {
mtag = swf_InsertTag(mtag, ST_DEFINEFONTALIGNZONES);
swf_FontSetAlignZones(mtag, iterator->swffont);
} else {
i->chardata = charbuffer_append(i->chardata, i->swffont, glyph, x, y, i->current_font_size, *(RGBA*)color, &i->fontmatrix);
}
- swf_FontUseGlyph(i->swffont, glyph);
+ swf_FontUseGlyph(i->swffont, glyph, i->current_font_size);
return;
}