From: kramm Date: Wed, 2 Jun 2004 19:19:54 +0000 (+0000) Subject: added a size argment to swf_DrawText. X-Git-Tag: release-0-6-0~146 X-Git-Url: http://git.asbjorn.biz/?a=commitdiff_plain;ds=sidebyside;h=2cb5e2da8a910e8afeabba2eadf259260052ae3b;hp=6052834ef4944e94adc5b120564339beec203710;p=swftools.git added a size argment to swf_DrawText. --- diff --git a/lib/modules/swftext.c b/lib/modules/swftext.c index b0b4cc2..683f494 100644 --- a/lib/modules/swftext.c +++ b/lib/modules/swftext.c @@ -1254,7 +1254,7 @@ void swf_FontCreateLayout(SWFFONT*f) } } -void swf_DrawText(drawer_t*draw, SWFFONT*font, char*text) +void swf_DrawText(drawer_t*draw, SWFFONT*font, int size, char*text) { U8*s = (U8*)text; int advance = 0; @@ -1270,26 +1270,26 @@ void swf_DrawText(drawer_t*draw, SWFFONT*font, char*text) while(l) { if(l->type == moveTo) { FPOINT to; - to.x = l->x/20.0+advance; - to.y = l->y/20.0; + to.x = l->x*size/100.0/20.0+advance; + to.y = l->y*size/100.0/20.0; draw->moveTo(draw, &to); } else if(l->type == lineTo) { FPOINT to; - to.x = l->x/20.0+advance; - to.y = l->y/20.0; + to.x = l->x*size/100.0/20.0+advance; + to.y = l->y*size/100.0/20.0; draw->lineTo(draw, &to); } else if(l->type == splineTo) { FPOINT mid,to; - mid.x = l->sx/20.0+advance; - mid.y = l->sy/20.0; - to.x = l->x/20.0+advance; - to.y = l->y/20.0; + mid.x = l->sx*size/100.0/20.0+advance; + mid.y = l->sy*size/100.0/20.0; + to.x = l->x*size/100.0/20.0+advance; + to.y = l->y*size/100.0/20.0; draw->splineTo(draw, &mid, &to); } l = l->next; } swf_Shape2Free(shape2); - advance += font->glyph[g].advance/20.0; + advance += font->glyph[g].advance*size/100.0/20.0; } }