
Hi all,
On the user maillist there has been a discussion on a (imo) very serious flaw in the units (px, cm, in, m, ...) in Inkscape.
In short, all units except 'px' are a 'lie'. Inkscape stores lengths in 'px' unit, while the SVG standard nowhere specifies the ratio between 'px' and one of the other units Inkscape features (like inch, cm, m, ...). Inkscape relates inch and other units to 'px' by assuming 90 px = 1 in. This is not defined in the SVG standard nor in the SVG file Inkscape creates.
Although SVG permits the use of several other units besides 'px', for example inches, Inkscape luckily uses only px units to store graphics (correct me if I am wrong). This means that all objects will scale the same, whatever the ratio between 'px' and 'inch' is chosen on interpretation. Unfortunately, the absolute length information of objects is lost. These two rects have the same dimensions in Inkscape, but not in some other viewers (e.g. firefox): <rect width="90" height="90"/> <rect width="1in" height="1in"/>
My concern is the following. Inkscape now chooses 90 px = 1 in. But this information is not stored in the SVG. If someone desides to have Inkscape follow the CSS default (96 px = 1 in) and changes Inkscape's code, this would mean that all old files will be opened with wrong dimensions. For webgraphics, perhaps not a big deal. For my book cover, for my technical drawings, etc... this is a very very big deal.
So we have to come up with an idea to explicitly define the lengths of the units we expose to the user. Jon has suggested using the 'viewBox' attribute. In think that <svg width="2in" height="2in" viewBox="0 0 180 180"> would explicitly define Inkscape's measure of 90 px = 1 inch (viewbox coords are expressed in px). Perhaps there are better ideas to solve this.
Ciao, Johan