[C++]How to parse SVG Path.

Post questions on how to use or achieve an effect in Inkscape.
tlaguz

[C++]How to parse SVG Path.

Postby tlaguz » Thu Feb 11, 2010 7:36 pm

Hi.

I have to parse many SVG Paths like that one:

Code: Select all

<path id="aaa" d="M772.53 850.70l 3.33 .65 9.35-56.23 1.85 .22 14.46-87.88-.68-.06-3.93 1.42-.84-.51-23.54 142.39"></path>


And I have to convert it to a two-dimensional coordinate system.

Does anybody know how to do that?
I found this file using google:
http://inkscape.modevia.com/doxygen/htm ... source.php
But I don't know how to use it.

Thank you in advance for your reply
tlaguz

P.S. Sorry for my english ^^

User avatar
sas
Posts: 404
Joined: Sat Oct 06, 2007 5:42 am

Re: [C++]How to parse SVG Path.

Postby sas » Thu Feb 11, 2010 8:54 pm

The SVG path specification is easy to follow, and includes a BNF grammar. It should be straightforward to write a parser for it in C++. (I did one once in Python, and it wasn't hard.)

I found this file using google:
http://inkscape.modevia.com/doxygen/htm ... source.php
But I don't know how to use it.

It's part of 2Geom, so you should read their documentation if you want to use it.


Return to “Help with using Inkscape”