Hello

I tried to use path data generated by gnuplot in a swfc .outline but had to manually insert
whitespace between the M and L path commands and the position data.
According to the SVG 1.1 spec :
"Superfluous white space and separators such as commas can be eliminated (e.g., "M 100 100 L 200 200" contains unnecessary spaces and could be expressed more compactly as "M100 100L200 200")."
Ref:  http://www.w3.org/TR/SVG11/paths.html#PathDataGeneralInformation
So it seems that gnuplot was right after all.

This can be fixed in the getToken function in drawer.c

diff orig/swftools-0.7.0/lib/drawer.c  swftools-0.7.0/lib/d rawer.c
27a28
> #include <ctype.h>
38c39,49
<     while(**p && !strchr(" ,()\t\n\r", **p)) {
---
> /*
>    SVF pathdata can exclude whitespace after L and M commands.
>    Ref:  http://www.w3.org/TR/SVG11/paths.html#PathDataGeneralInformation
>    This allows us to use svg files output from gnuplot.
>    Also checks for relative MoveTo and LineTo (m and l).
>    051106 Magnus Lundin, [EMAIL PROTECTED]
> */
> if (strchr("LMlm", **p) && (isdigit(*(*p+1))||strchr("+-", *(*p+1)))) {
>         (*p)++;
>     }
>     else while(**p && !strchr(" ,()\t\n\r", **p)) {

This is perhaps not a beautiful patch ibut it semms to do the trick.

Magnus Lundin


_______________________________________________
Swftools-common mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/swftools-common

Reply via email to