static int optimize = 0;
static int swifty = 0;
static int verbose = 0;
-static int showbbox = 1;
-static int showorigbbox = 0;
+static int showbbox = 0;
+static int showorigbbox = 1;
static int expand = 1;
static struct options_t options[] = {
static int fontnum = -1;
static SWFFONT**fonts;
static SWF*c_swf;
-static void fontcallback1(U16 id,U8 * name)
+static void fontcallback1(void*self, U16 id,U8 * name)
{ fontnum++;
}
-static void fontcallback2(U16 id,U8 * name)
+static void fontcallback2(void*self, U16 id,U8 * name)
{
fonts[fontnum] = 0;
swf_FontExtract(c_swf,id,&fonts[fontnum]);
int ch;
SRECT newglyphbbox, glyphbbox = font->layout->bounds[chars[t]];
MATRIX m = bounds->m;
-
+ SPOINT p;
+
if(chars[t] < font->numchars && font->glyph2ascii) {
ch = font->glyph2ascii[chars[t]];
}
+ p.x = x; p.y = y;
+ p = swf_TurnPoint(p, &m);
+
m.sx = (m.sx * fontsize) / 1024;
m.sy = (m.sy * fontsize) / 1024;
m.r0 = (m.r0 * fontsize) / 1024;
m.r1 = (m.r1 * fontsize) / 1024;
- m.tx += x;
- m.ty += y;
+ m.tx += p.x;
+ m.ty += p.y;
newglyphbbox = swf_TurnRect(glyphbbox, &m);
if(ch<32) ch='?';
if(verbose) printf("Extracting fonts...\n");
c_swf = swf;
fontnum = 0;
- swf_FontEnumerate(swf,&fontcallback1);
+ swf_FontEnumerate(swf,&fontcallback1,0);
fonts = (SWFFONT**)malloc(fontnum*sizeof(SWFFONT*));
memset(fonts, 0, fontnum*sizeof(SWFFONT*));
fontnum = 0;
- swf_FontEnumerate(swf,&fontcallback2);
+ swf_FontEnumerate(swf,&fontcallback2,0);
}
memset(&bounds, 0, sizeof(bounds));