
Thank you Aaron!
But the biggest problem not. Inkscape does handle the unit in px despite is it specified in mm, and misinterpretes the file (L 20 40mm L 10 20 -> L 20 40 M 10 20) which is not only affect the size of the object, but actually modify it!
"L 20 40mm L 10 20" is invalid SVG. The <path /> d attribute IS specified in px (meaning svg user space units not pixels). Please confer with the grammar in the SVG specification:
Yes, from the grammar, it stands clearly, that the coordinates must be only integer and floating point with sign (2, -2, 2.2, -2.2). No other suffix (mm, in) is permitted.
Thank you for the link, it clarifies a lot.
If you want to use another coordinate system for px you need to use one of the SVG methods for altering the coordinate system: transform or, more likely, viewBox. Please confer with the discussion of Coordinate Systems, Transformations and Units in the SVG spec for details:
I was there yesterday (before posting my question), but surely i must misinterpreted something.
My understanding is that you must specify the width and height of your document in real world units and adjust the user space coordinate system to match. For example:
<svg width="20mm" height="45mm" viewBox="0 0 20 45" />
It clarifies up a lot!
I don't know if you will be able to flip your coordinate system with the viewBox attribute (i.e. viewBox="0 45 20 0").
No, you dont. I think for flipping the coordinate system it must be used the "transform" command.
"Known Issue: Cartesian Coordinate System for SVG" http://support.adobe.com/devsup/devsup.nsf/docs/50556.htm
"7.6 The transform attribute" http://www.w3.org/TR/SVG11/coords.html#TransformAttribute
<g transform="translate(0,[DOCUMENT_HEIGHT]) scale(1,-1)"> <!-- graphics elements go here --> </g>
or
<g transform="matrix(1 0 0 -1 0 [DOCUMENT_HEIGHT])"> <!-- graphics elements go here --> </g>
(all units are in px)
And to translate between px and real coordinate units(mm,in), you must use viewbox at the very beginning.
<svg width="20mm" height="45mm" viewBox="0 0 20 45" />
I'm sure altering Inkscape to work better with other coordinate systems would be welcome.
Sure. But before that it would be nice to discover, what are the standard compliant solutions/possibilities.
So summerizing up, here is a simple svg which are supposed to be standard compliant:
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <svg xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="210mm" height="297mm" viewBox="0 0 210 297">
<g transform="translate(0,297) scale(1,-1)"> <g inkscape:label="1. layer" inkscape:groupmode="layer" id="layer1"> <path style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" d="M 0,0 L 30,0 L 30,30" id="path7884"/> </g> </g> </svg>
I would like to note here that the link: http://www.inkscape.org/namespaces/inkscape does not work. Dont know if its an error or not.
I attache also a more complete .svg file. For anyone who is interested in this issue.
Aaron: what would be the best method to resolve this issue? Produces simple use cases, and .svg files?
For some, many of us could help. (Like documenting the difference between inkscape behaviour and the expected behaviour)
I try to digg a bit more into it. Maybe working with px units, and after finishing the document I add a viewbox with a text editor would be the temporal solution.
Best regards, Khiraly