On Tue, 27 May 2008 09:55:32 +0200, <J.B.C.Engelen@...1578...> wrote:
-----Original Message----- From: Marco [mailto:mrcekets@...400...] Sent: dinsdag 27 mei 2008 0:54 To: inkscape-devel@lists.sourceforge.net; lib2geom-devel@lists.sourceforge.net Cc: njh; Engelen, J.B.C. (Johan) Subject: [Inkscape-devel][Lib2geom-devel] New HLineSegment/VLineSegment classes and path.h splitting
The HLineSegment and VLineSegment classes will be useful to represent directly "H" and "V" curves found in the svg path element.
I committed all changes both to 2geom and Inkscape.
Cool thanks!
Marco: Can you add the new V/HLineSegments to 2geom's svgparser? Jasper: Can you add special commands for these segments to svg/pathstring.h ? I will then have the new 2geom-type path writer call these functions.
Cheers, Johan
I added methods to PathSink to manage horizontal and vertical lines, and I modified the parser toy and svg-path-parser.rl accordingly anyway it seems that the parser is unable to parse correctly single coordinate, so H, V and A path elements are not parsed correctly. I spent the afternoon in trying to fix it but I didn't understand part of raleg state machine generator syntax. In particular how "coordinate_pair" are parsed and how priority feature is supposed to work. As of this fact I committed the changes to 2geom only at present.
You can test the above issue using the parser toy with simple string input as:
parser "M 10 10 H 20" output: M X: 10 Y: 10 H 2 H 0
parser "M 10 10 V 125" output: M X: 10 Y: 10 V 1 V 2 V 5
parser "M 10 10 H 20 10" output: M X: 10 Y: 10 H 2 H 0 H 10
parser "M 302 152 A 150, 120, 0, 1, 0, 2 152" output: M X: 302 Y: 152 A 0 0 1 0 0 X: 2 Y: 152 // should be A 150 120 0 1 0 X: 2 Y: 152
parser "M 300 150 A 150, 120, 30, 1, 0, 200 100" output: M X: 300 Y: 150 A 0 120 30 1 0 X: 200 Y: 100 // should be A 150 120 30 1 0 X: 200 Y: 100
if someone that knows ragel could fix all that it will be great.
Regards, Marco