git.asbjorn.biz
/
swftools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added glyph pairing to align zone detector
[swftools.git]
/
lib
/
devices
/
swf.c
diff --git
a/lib/devices/swf.c
b/lib/devices/swf.c
index
121d49c
..
a3f57e9
100644
(file)
--- a/
lib/devices/swf.c
+++ b/
lib/devices/swf.c
@@
-623,6
+623,7
@@
static void chararray_writetotag(chararray_t*_chardata, TAG*tag)
int lastx;
int lasty;
int lastsize;
int lastx;
int lasty;
int lastsize;
+ int lastchar;
int charids[128];
int charadvance[128];
int charstorepos;
int charids[128];
int charadvance[128];
int charstorepos;
@@
-646,6
+647,7
@@
static void chararray_writetotag(chararray_t*_chardata, TAG*tag)
lastx = CHARMIDX;
lasty = CHARMIDY;
lastsize = -1;
lastx = CHARMIDX;
lasty = CHARMIDY;
lastsize = -1;
+ lastchar = -1;
if(pass==1)
{
if(pass==1)
{
@@
-670,9
+672,9
@@
static void chararray_writetotag(chararray_t*_chardata, TAG*tag)
charatposition_t*chr = &chardata->chr[t];
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 ||
!colorcompare(&color, &chardata->chr[t].color) ||
charstorepos==127 ||
lastsize != chardata->chr[t].size ||
@@
-736,6
+738,12
@@
static void chararray_writetotag(chararray_t*_chardata, TAG*tag)
lastx = chr->x;
lasty = chr->y;
lastsize = chr->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(islast)
@@
-745,7
+753,7
@@
static void chararray_writetotag(chararray_t*_chardata, TAG*tag)
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;
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;
int advance;
if(dx>=0 && (dx<(1<<(advancebits-1)) || pass==0)) {
advance = dx;
@@
-754,8
+762,10
@@
static void chararray_writetotag(chararray_t*_chardata, TAG*tag)
advance = 0;
lastx=chr->x;
}
advance = 0;
lastx=chr->x;
}
+
charids[charstorepos] = chr->charid;
charadvance[charstorepos] = advance;
charids[charstorepos] = chr->charid;
charadvance[charstorepos] = advance;
+ lastchar = chr->charid;
charstorepos ++;
}
chardata = chardata->next;
charstorepos ++;
}
chardata = chardata->next;
@@
-3117,6
+3127,6
@@
static void swf_drawchar(gfxdevice_t*dev, gfxfont_t*font, int glyph, gfxcolor_t*
} else {
i->chardata = charbuffer_append(i->chardata, i->swffont, glyph, x, y, i->current_font_size, *(RGBA*)color, &i->fontmatrix);
}
} 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;
}
return;
}