From: Krzysztof K. <twe...@gm...> - 2013-08-15 00:48:16
|
2013/8/13 Vinícius dos Santos Oliveira <vin...@gm...> > Anyway, what I need is to do the other way back (generate a SVG file from some Geom::PathVector). The only code I found related to this functionality lies in the toys (not part of the lib) and uses a complicated scheme involving cairo and a lot of virtual func calls. Is there another way? If there is not, I want to implement it and I want to implement it fast. Would be possible to release another lib2geom version fast if code goes okay? This functionality is already present in Inkscape, see src/svg/path-string.cpp. However, it would be a good idea to move it into 2Geom. Here is the optimal plan: 1. Make a method on SVGPathSink to output a PathVector into it. You can copy the relevant code with some modification from Inkscape, see src/svg/svg-path.cpp, or generalize the output_svg_path function. 2. Derive from SVGPathSink and implement SVGPathDataBuilder, a class based on the code in src/svg/path-string.cpp. Regards, Krzysztof |