git.asbjorn.biz
/
swftools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed bug in reader_memread()
[swftools.git]
/
lib
/
devices
/
swf.c
diff --git
a/lib/devices/swf.c
b/lib/devices/swf.c
index
205163f
..
8cbfec0
100644
(file)
--- a/
lib/devices/swf.c
+++ b/
lib/devices/swf.c
@@
-81,7
+81,6
@@
typedef struct _swfoutput_internal
int config_drawonlyshapes;
int config_jpegquality;
int config_storeallcharacters;
int config_drawonlyshapes;
int config_jpegquality;
int config_storeallcharacters;
- int config_generate_fake_tags;
int config_enablezlib;
int config_insertstoptag;
int config_flashversion;
int config_enablezlib;
int config_insertstoptag;
int config_flashversion;
@@
-234,7
+233,6
@@
static swfoutput_internal* init_internal_struct()
i->config_jpegquality=85;
i->config_storeallcharacters=0;
i->config_enablezlib=0;
i->config_jpegquality=85;
i->config_storeallcharacters=0;
i->config_enablezlib=0;
- i->config_generate_fake_tags=0;
i->config_insertstoptag=0;
i->config_flashversion=6;
i->config_framerate=0.25;
i->config_insertstoptag=0;
i->config_flashversion=6;
i->config_framerate=0.25;
@@
-729,6
+727,10
@@
static int drawchar(gfxdevice_t*dev, SWFFONT *swffont, int charid, float x, floa
p.y = (SCOORD)((- x * i->fontmatrix.r0/65536.0 + y * i->fontmatrix.sx/65536.0)*det);
RGBA rgba = *(RGBA*)col;
p.y = (SCOORD)((- x * i->fontmatrix.r0/65536.0 + y * i->fontmatrix.sx/65536.0)*det);
RGBA rgba = *(RGBA*)col;
+
+ msg("<trace> Drawing char %d in font %d at %d,%d in color %02x%02x%02x%02x",
+ charid, swffont->id, p.x,p.y, rgba.r, rgba.g, rgba.b, rgba.a);
+
putcharacter(dev, swffont->id, charid,p.x,p.y,i->current_font_size, rgba);
swf_FontUseGlyph(swffont, charid);
return 1;
putcharacter(dev, swffont->id, charid,p.x,p.y,i->current_font_size, rgba);
swf_FontUseGlyph(swffont, charid);
return 1;
@@
-1278,13
+1280,8
@@
int swfresult_save(gfxresult_t*gfx, const char*filename)
return -1;
}
return -1;
}
- if(swf->compressed) {
- if FAILED(swf_WriteSWC(fi,swf))
- msg("<error> WriteSWC() failed.\n");
- } else {
- if FAILED(swf_WriteSWF(fi,swf))
- msg("<error> WriteSWF() failed.\n");
- }
+ if FAILED(swf_WriteSWF(fi,swf))
+ msg("<error> WriteSWF() failed.\n");
if(filename)
close(fi);
if(filename)
close(fi);
@@
-1805,8
+1802,6
@@
int swf_setparameter(gfxdevice_t*dev, const char*name, const char*value)
if(i->config_protect && i->tag) {
i->tag = swf_InsertTag(i->tag, ST_PROTECT);
}
if(i->config_protect && i->tag) {
i->tag = swf_InsertTag(i->tag, ST_PROTECT);
}
- } else if(!strcmp(name, "faketags")) {
- i->config_generate_fake_tags = atoi(value);
} else if(!strcmp(name, "flashversion")) {
i->config_flashversion = atoi(value);
if(i->swf) {
} else if(!strcmp(name, "flashversion")) {
i->config_flashversion = atoi(value);
if(i->swf) {
@@
-2475,8
+2470,8
@@
static SWFFONT* gfxfont_to_swffont(gfxfont_t*font, const char* id)
advance = xmax;
}
advance = xmax;
}
- if(advance<32768) {
- swffont->glyph[t].advance = advance;
+ if(advance<32768/20) {
+ swffont->glyph[t].advance = advance*20;
} else {
swffont->glyph[t].advance = 32767;
}
} else {
swffont->glyph[t].advance = 32767;
}
@@
-2494,6
+2489,9
@@
static SWFFONT* gfxfont_to_swffont(gfxfont_t*font, const char* id)
swffont->layout->descent = (bounds.ymax - bounds.ymin)/2;
swffont->layout->leading = bounds.ymax - bounds.ymin;
}
swffont->layout->descent = (bounds.ymax - bounds.ymin)/2;
swffont->layout->leading = bounds.ymax - bounds.ymin;
}
+ swffont->layout->descent= (bounds.ymax - bounds.ymin);
+ swffont->layout->ascent = 0;
+ swffont->layout->leading = bounds.ymax - bounds.ymin;
return swffont;
}
return swffont;
}
@@
-2572,8
+2570,10
@@
static void swf_switchfont(gfxdevice_t*dev, const char*fontid)
static void swf_drawchar(gfxdevice_t*dev, gfxfont_t*font, int glyph, gfxcolor_t*color, gfxmatrix_t*matrix)
{
swfoutput_internal*i = (swfoutput_internal*)dev->internal;
static void swf_drawchar(gfxdevice_t*dev, gfxfont_t*font, int glyph, gfxcolor_t*color, gfxmatrix_t*matrix)
{
swfoutput_internal*i = (swfoutput_internal*)dev->internal;
- if(!font)
+ if(!font) {
+ msg("<error> swf_drawchar called (glyph %d) without font", glyph);
return;
return;
+ }
if(!i->swffont || !i->swffont->name || strcmp((char*)i->swffont->name,font->id)) // not equal to current font
{
if(!i->swffont || !i->swffont->name || strcmp((char*)i->swffont->name,font->id)) // not equal to current font
{