+// swf_ShapeFree(draw->s);
+ // draw->s = 0;
+}
+
+static char* getToken(const char**p)
+{
+ const char*start;
+ char*result;
+ while(**p && strchr(" ,\t\n\r", **p)) {
+ (*p)++;
+ }
+ start = *p;
+ while(**p && !strchr(" ,\t\n\r", **p)) {
+ (*p)++;
+ }
+ result = malloc((*p)-start+1);
+ memcpy(result,start,(*p)-start+1);
+ result[(*p)-start] = 0;
+ return result;
+}
+
+void swf_DrawString(SWFSHAPEDRAWER*draw, const char*string)
+{
+ const char*p = string;
+ while(*p) {
+ char*token = getToken(&p);
+ if(!strncmp(token, "moveTo", 6)) {
+ FPOINT to;
+ to.x = atoi(getToken(&p));
+ to.y = atoi(getToken(&p));
+ swf_DrawerMoveTo(draw, &to);
+ }
+ else if(!strncmp(token, "lineTo", 6)) {
+ FPOINT to;
+ to.x = atoi(getToken(&p));
+ to.y = atoi(getToken(&p));
+ swf_DrawerLineTo(draw, &to);
+ }
+ else if(!strncmp(token, "curveTo", 7) || !strncmp(token, "splineTo", 8)) {
+ FPOINT mid,to;
+ mid.x = atoi(getToken(&p));
+ mid.y = atoi(getToken(&p));
+ to.x = atoi(getToken(&p));
+ to.y = atoi(getToken(&p));
+ swf_DrawerSplineTo(draw, &mid, &to);
+ }
+ free(token);
+ }
+ //swf_DrawerFinish(draw); // must be done by application.