Hi Alvin,
I think your confusion stems from using "document units". This name
is very ambiguous and should not be used. Instead, distinguish between
"Display units" and "SVG units" (SVG "user-units"). Display
units is for
UI purposes, and is completely (*completely*) unrelated to the units for
the values in SVG.
"inkscape:document-units" specifies Display units (as it always has),
and is unrelated to SVG units. The big problem we had in trunk was that
"inkscape:document-units" was mixed with SVG units. We killed that, and
now most is fine again, afaik.
SVG units are defined by document height/width (defaults to "px" units)
and the viewbox numbers. From that information, Inkscape (and python
script inkex.py) calculates the SVG unit.
Only issue I know of, is that when a user manually changes the viewbox,
without an according change in document height/width, Inkscape does not
recalculate what SVG unit is used. You would have to reload the file.
Also, Inkscape at the moment does not support SVG units other than the
units it knows of upon load. This is easy to fix, however not done yet.
On 30-11-2014 18:18, alvinpenner wrote:
Here is my personal wishlist of things that need to be fixed for
0.92.
1. We need to re-enable the Document Properties setting that allows us to
specify the variable inkscape:document-units. I understand that this was
disabled for the purpose of being able to release 0.91. But now that we are
discussing 0.92 this setting should be re-enabled in trunk. The point is
that we cannot evaluate, or test, or fix, the bugs associated with changing
document units in current trunk, see Bug 1397564.
Specifying inkscape:document-units from the Document Properties dialog
has never been disabled.
0.91 and trunk actually behave the same for units. You can change
display units (like all previous versions of Inkscape), and there is no
UI for changing SVG units.
2. I believe a suggestion has been made that we might want to
distinguish
between Display Units and Document Units (or what was previously called
Default Units) in the future, after changing Document Units has been
re-enabled in trunk. (Unfortunately I cannot locate the precise reference).
I would like to vote against that, even before the vote is held.
We have proven that we cannot do it (combining Display units and SVG
units). We now have separated the difference between Display units and
SVG units clearly in code, and poofff!, gone are the bugs and problems. :)
We already
have far too many different definitions of units as it is. I have counted,
in the gui, no less than 12 different locations where a drop down box exists
that allows you to change units, including things like Prefs and Fill&Stroke
and so on. This is too many. We need to reduce the number of different
definitions of units, not add more. No user can be expected to make sense
out of this, I certainly can't.
This is a separate issue. And really, all those dropboxes relate to
Display units.
3. On the same subject, the interaction between these different drop
down
boxes is sometimes unpredictable, meaning that it is sometimes one way. For
example, changing Display Units in Document Properties will change the units
associated with the F1 toolbar if it is active. However any change in the F1
toolbar units will not affect the Display Units. The same type of one-way
linkage occurs also for F2, M, and F4. I would suggest that one-way linkages
of this type should be forbidden because they are confusing.
4. On a somewhat similar note, the namedview section of XML contains a
variable called 'units', which appears to be redundant, since the page size
units are now stored directly in the width and height variables in the root.
I would suggest it be removed. I would be more than happy to fix any
breakage that might occur in the Python Extension system as a result.
Sounds good, go ahead and kill it.
5. For aesthetic reasons I would like to see someone tackle Bug
1369197
which relates to transformation of displacements during a unit change. I
think this is probably beyond me, but it gives the Inkscape representation a
very unexpected/unpredictable behavior after applying a unit change.
This is one of the many difficulties in actually changing the SVG units
for an existing document.
- Johan