X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=lib%2Fdrawer.c;fp=lib%2Fdrawer.c;h=bcab2eb965d2bb338e4a491f4fed465d1bfbac1a;hp=bf8f5cdb67be4cbc157c5d16e11e46a96f53e0d9;hb=480e90b98a4744dfaad8be1f8f40024dbdba3b96;hpb=75585d325955f12c29411a60b999541226ebd3ca diff --git a/lib/drawer.c b/lib/drawer.c index bf8f5cd..bcab2eb 100644 --- a/lib/drawer.c +++ b/lib/drawer.c @@ -64,13 +64,17 @@ void draw_string(drawer_t*draw, const char*string) char*token = getToken(&p); if(!token || !*token) break; - if(!strncmp(token, "moveTo", 6)) { + if(!strncmp(token, "moveTo", 6) || + !strncmp(token, "M", 1) //svg + ) { FPOINT to; to.x = atoi(getToken(&p)); to.y = atoi(getToken(&p)); draw->moveTo(draw, &to); } - else if(!strncmp(token, "lineTo", 6)) { + else if(!strncmp(token, "lineTo", 6) || + !strncmp(token, "L", 1) //svg + ) { FPOINT to; to.x = atoi(getToken(&p)); to.y = atoi(getToken(&p)); @@ -92,7 +96,9 @@ void draw_string(drawer_t*draw, const char*string) to.y = atoi(getToken(&p)); draw_conicTo(draw, &mid, &to); } - else if(!strncmp(token, "cubicTo", 5)) { + else if(!strncmp(token, "cubicTo", 5) || + !strncmp(token, "C", 1) //svg + ) { FPOINT mid1,mid2,to; mid1.x = atoi(getToken(&p)); mid1.y = atoi(getToken(&p)); @@ -102,7 +108,12 @@ void draw_string(drawer_t*draw, const char*string) to.y = atoi(getToken(&p)); draw_cubicTo(draw, &mid1, &mid2, &to); } - else fprintf(stderr, "drawer: Warning: unknown primitive '%s'\n", token); + else if(!strncmp(token, "z", 1) //svg + ) { + // ignore + } + else + fprintf(stderr, "drawer: Warning: unknown primitive '%s'\n", token); free(token); }