Illustrator SVG curveto from relative to absolute

I'm trying to get SVGKit (looks like a great tool!) to render files containing anything more complicated than a simple rectangle or circle. I started by trying to mimmic the SVG (XML) from the SVGKit samples and I noticed the SVG that Illustrator (CS4) exports is a bit different.

  • Open <path ... /> tags from Illustrator vs. closed <path ... ></path> tags from the samples. This turns out to be irrelevant, though.

  • Relative curveto ( c ) in Illustrator vs. absolute curveto ( C ) from SVGKit samples.


  • I tried copying the SVG for a couple paths from the samples into my Illustrator-generated SVG file.
  • However, upon opening in Illustrator and moving the newly-copied objects to a new (x,y) location, it seems that the curveto commands have been altered from absolute ( C ) to relative ( c ) (and thus include negative values).
  • These no longer render in SVGKit. (Actually they cause EXC_BAD_ACCESS errors and Core Graphics to throw errors).

    Long story short, is there any good way to force Illustrator to keep absolute curveto commands in its SVG? Or to keep it from significantly altering the SVG commands on shapes that are simply being moved?


    Short answer: in Dec 2011, SVGKit just "didn't work" for most SVGs.

    All the stuff you describe got fixed early this year, and now it's geting much closer to conforming with the spec.

    Also ... a big change coming soon to simpler / easier to use API (which is closer to the SVG spec). You can try it out here: https://github.com/adamgit/SVGKit/tree/transforms - but that branch is currently "in development". It's pretty stable, but sometimes gets exprimental commits.

    链接地址: http://www.djcxy.com/p/95742.html

    上一篇: 如何在Google Maps API v3中的SVG路径中指示透明度?

    下一篇: Illustrator SVG曲线从相对于绝对