X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fswfc.c;h=75b38a37b4750bfba396ca7f9e0e5d241c264c2f;hb=ec435f9141fe14ffb0d91ea1d5d556b1562e68d0;hp=54b51ee34fcd8ed0e9e6b2e9ec7c5c70ab425a97;hpb=f9a5a4d2a65708ee202e987e857556e9615a45d9;p=swftools.git diff --git a/src/swfc.c b/src/swfc.c index 54b51ee..75b38a3 100644 --- a/src/swfc.c +++ b/src/swfc.c @@ -508,9 +508,6 @@ void s_buttonput(char*character, char*as, parameters_t p) break; s++; } - printf("%s\n", as); - swf_DumpMatrix(stdout,&mybutton.records[0].matrix); - } static void setbuttonrecords(TAG*tag) { @@ -850,7 +847,7 @@ void s_circle(char*name, int r, RGBA color, int linewidth, char*texture) incrementid(); } -void s_textshape(char*name, char*fontname, char*_text) +void s_textshape(char*name, char*fontname, float size, char*_text) { int g; U8*text = (U8*)_text; @@ -876,7 +873,7 @@ void s_textshape(char*name, char*fontname, char*_text) { drawer_t draw; swf_Shape11DrawerInit(&draw, 0); - swf_DrawText(&draw, font, _text); + swf_DrawText(&draw, font, (int)(size*100), _text); draw.finish(&draw); outline->shape = swf_ShapeDrawerToShape(&draw); outline->bbox = swf_ShapeDrawerGetBBox(&draw); @@ -2220,8 +2217,9 @@ static int c_textshape(map_t*args) char*name = lu(args, "name"); char*text = lu(args, "text"); char*font = lu(args, "font"); + float size = parsePercent(lu(args, "size")); - s_textshape(name, font, text); + s_textshape(name, font, size, text); return 0; } @@ -2443,6 +2441,7 @@ static int c_edittext(map_t*args) char*htmlstr = lu(args, "html"); char*noselectstr = lu(args, "noselect"); char*readonlystr = lu(args, "readonly"); + char*borderstr = lu(args, "border"); int flags = 0; if(!strcmp(passwordstr, "password")) flags |= ET_PASSWORD; @@ -2451,6 +2450,7 @@ static int c_edittext(map_t*args) if(!strcmp(readonlystr, "readonly")) flags |= ET_READONLY; if(!strcmp(htmlstr, "html")) flags |= ET_HTML; if(!strcmp(noselectstr, "noselect")) flags |= ET_NOSELECT; + if(!strcmp(borderstr, "border")) flags |= ET_BORDER; s_edittext(name, font, size, width, height, text, &color, maxlength, variable, flags); return 0; @@ -2495,7 +2495,7 @@ static struct { {"point", c_point, "name x=0 y=0"}, {"gradient", c_gradient, "name @radial=0"}, {"outline", c_outline, "name format=simple"}, - {"textshape", c_textshape, "name text font"}, + {"textshape", c_textshape, "name font size=100% text"}, // character generators {"box", c_primitive, "name width height color=white line=1 @fill=none"}, @@ -2504,7 +2504,7 @@ static struct { {"egon", c_egon, "name vertices color=white line=1 @fill=none"}, {"text", c_text, "name text font size=100% color=white"}, - {"edittext", c_edittext, "name font size=100% width height text="" color=white maxlength=0 variable="" @password=0 @wordwrap=0 @multiline=0 @html=0 @noselect=0 @readonly=0"}, + {"edittext", c_edittext, "name font size=100% width height text="" color=white maxlength=0 variable="" @password=0 @wordwrap=0 @multiline=0 @html=0 @noselect=0 @readonly=0 @border=0"}, {"morphshape", c_morphshape, "name start end"}, {"button", c_button, "name"}, {"show", c_show, "name x=0 y=0 red=+0 green=+0 blue=+0 alpha=+0 luminance= scale= scalex= scaley= pivot= pin= shear= rotate= ratio= above= below= as="},