On Thu, 2014-12-04 at 15:40 +0100, Krzysztof KosiĆski wrote:
2014-12-03 14:40 GMT+01:00 Tavmjong Bah <tavmjong@...8...>:
Hi,
I have been living, breathing, and even dreaming units the past couple of weeks. My understanding of what Inkscape does and what it should do has evolved over the time period but now I think it has pretty much solidified. I thank all those that have given feedback.
I've tried to put all this knowledge at one place:
wiki.inkscape.org/wiki/index.php/Units_In_Inkscape
Conclusions:
- There are only three attributes that matter:
The SVG root 'width'
The SVG root 'height'
The 'viewBox'
Together they define a mapping of the real world to 'user units', in
particular they define a scaling factor.
Note from me:
My understanding is that SVG root width / height is different from all the other unit-bearing lengths in the document. For example, when a rect is defined with height equal to 10mm, it is converted to the relevant number of user units, using the fixed ratio of 96 user units per inch. However the SVG root width / height specify the actual physical dimensions of the image, so if display resolution information is available (e.g. from EDID), the image should be displayed in the specified physical size.
In other words an image that has height="1in" and width="1in" on the SVG root is not guaranteed to always take up 96x96 pixels - the user agent should figure out the resolution of the display, and on a 150dpi display the image should be 150x150 pixels.
Correct (and a rectangle with a width of 96px would be shown on the display with a width of 150 display pixels).
It is unfortunate that inside an SVG file the unit-identifier of 'px' was chosen to represent on 'user unit'. A 'pixel' inside an SVG file is ->not<- the same as a screen pixel except in the case where the 'viewBox' width and height match the SVG width and height measured in 'px' (or in the case where there is no 'viewBox') and where the SVG is being displayed with it's nominal width and height.
Tav
Regards, Krzysztof