ipe-tools icon indicating copy to clipboard operation
ipe-tools copied to clipboard

svgtoipe

Open v217 opened this issue 5 years ago • 2 comments

First of all there is an easy workaround! For some reason svgtoipe can't read this svg file:

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="40.21999999999997mm" height="17.110000000000014mm" viewBox="455.16 543.29 495.38 560.4"> <path stroke="black" fill="none" d="M456.28,544.52 456.28 544.52,456.23 544.48 C456.07 544.35,455.78 544.11,455.43 543.8 C455.18 543.48,455.16 543.29,455.4 543.29 C455.8 543.48,456.27 543.79,456.75 544.15 C457.24 544.49,457.75 544.81,458.32 545.12 C459.01 545.46,459.84 545.85,460.85 546.33 C462.09 546.9,463.58 547.55,465.36 548.25 C467.4 549.02,469.66 549.84,472.02 550.71 C474.39 551.63,476.72 552.58,478.98 553.54 C481.18 554.51,483.31 555.44,485.37 556.3 C487.32 557.07,489.1 557.74,490.67 558.34 C492.02 558.86,493.15 559.29,494.05 559.62 C494.72 559.86,495.16 560.04,495.33 560.17 C495.37 560.27,495.38 560.33,495.36 560.4 C495.36 560.4"/>
</svg>

The file was produced by https://github.com/ngmsoftware/will2svg Now I use cairosvg to produce a new svg file which I can convert to an ipe file with svgtoipe. I wasn't able to find out what svgtoipe didn't understand?

v217 avatar Jun 02 '20 20:06 v217

svgtoipe.py cannot handle the implicit "lineto" commands in the moveto command used here - I didn't know this was legal until checking the svg specs now.

Thanks for the link to cairosvg, I'll have a look if we can reuse its svg parser to handle a wider range of svg inputs.

otfried avatar Jun 04 '20 09:06 otfried

Great Thank you! I could only figure out that it's not a trivial issue like a missing part of the preamble etc...

v217 avatar Jun 04 '20 10:06 v217