X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fdevices%2Fswf.c;h=8cbfec0d51bd0c5f9b751327f1387806f81d09af;hb=619c598195de4fc32af95d6b6608ba00f91b5dfc;hp=ced14e9ac3645e49c1e07a679b93f4a985d7020f;hpb=c6e838683c6443a30a7871298883985b90a92e78;p=swftools.git diff --git a/lib/devices/swf.c b/lib/devices/swf.c index ced14e9..8cbfec0 100644 --- a/lib/devices/swf.c +++ b/lib/devices/swf.c @@ -727,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; + + msg(" 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; @@ -2466,8 +2470,8 @@ static SWFFONT* gfxfont_to_swffont(gfxfont_t*font, const char* id) 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; } @@ -2485,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); + swffont->layout->ascent = 0; + swffont->layout->leading = bounds.ymax - bounds.ymin; return swffont; } @@ -2563,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; - if(!font) + if(!font) { + msg(" swf_drawchar called (glyph %d) without font", glyph); return; + } if(!i->swffont || !i->swffont->name || strcmp((char*)i->swffont->name,font->id)) // not equal to current font {