hi,
i just played around with the px/in conversion factor in the units.xml file and one thing came apparent: when you change this factor, you are not changing the px/in "unit", in reality you change the size of a pixel (since the size of inch is defined by the outside world), which affects ALL units.
internally all sizes are calculated with the intermediate step of converting into pixels. an example, converting mm to in:
100mm * 3.543307px/mm / 90px/in = 3.937007in (correct)
if i now just change the px/in definition to 96, i get:
100mm * 3.543307px/mm / 96px/in = 3,690944in (INcorrect and verified by changing the unit from mm to in on a 100mm cube in inkscape)
this means i also have to redefine px/mm to 3.779527:
100mm * 3.779527px/mm / 90px/in = 3.937007in (correct)
so if we redefine all the units and thus changing the "size" of a pixel, all conversions work as expected, just px will have a slightly different "viewing size" i think.
one question: what is the "default export resolution in preferences"?
regards, TimeWaster
On 23.4.2014 15:09, Tavmjong Bah wrote:
Hi TimeWaster and Nick,
Alvin Penner has suggested that I contact both of you about a change to Inkscape I am pushing for:
Currently Inkscape transforms non-pixel units (e.g 'in', 'cm') using the ratio 90 pixels per inch. This ratio is hinted at in SVG 1.1 but not explicitly defined (someday I'll blog about the history of this). CSS 2.1 does explicitly defined the ratio to be 96 pixels per inch, a standard that all web browsers as well a Batik have followed for many years. I recently proposed that in SVG one should be allowed to set this ratio but that idea was quickly rejected by the standards group.
Previous to Inkscape 0.91 all dimensions inside of Inkscape were stored only as pixels values (despite allowing the user to enter dimensions in other units). As long as one did not import SVGs from other sources the ratio between px and in was not all that important. With 0.91, one can optionally set font-size to be output in points. To ensure consistency with what is rendered in Inkscape and what is displayed by other SVG renderers we should move to the standard 96 pixels per inch per CSS2.1.
To make the change, two files must be modified:
share/extensions/inkex.py share/ui/units.xml
and probably the default export resolution should also be changed in preferences.
Alvin is afraid this will cause trouble in the world of desktop cutters and plotters. Do you see this as a problem?
Thanks,
Tav
BTW, the 0.91 release notes suggest that extensions relying on units other than pixels were already broken by the work on units.