W3C home > Mailing lists > Public > www-svg@w3.org > January 2006

RE: Is the px unit equivalent to user units?

From: Jon Ferraiolo <jonf@adobe.com>
Date: Tue, 3 Jan 2006 09:28:06 -0800
Message-ID: <6ECA24BE410D994496A2AE995367C5C8575EDD@namail3.corp.adobe.com>
To: "Doug Schepers" <doug@schepers.cc>, "Jonathan Watt" <jonathan.watt@strath.ac.uk>, <www-svg@w3.org>


Doug asked a real SVG WG member to chime in. Here goes.

SVG fundamentally is what its name says: scalable vector graphics. Other
scalable vector graphics technologies such as PostScript, PDF and Flash
use the same approach as SVG Tiny, where only (unitless) user units are
supported, and user coordinate systems are established by 2x3
transformation matrices or some sort of scale-to-fit facility (such as
SVG's viewBox).

I think nearly all of the long-standing members of the SVG WG would
agree that it would be preferable to drop CSS units from all version of
the SVG language (except for defining the intrinsic size of the graphic
via width/height on the root svg element) rather than require an
abomination such as requiring 'uu' or 'csu' on SVG length values just
because CSS purists have a religious issue about unitless values.

Jon

-----Original Message-----
From: www-svg-request@w3.org [mailto:www-svg-request@w3.org] On Behalf
Of Doug Schepers
Sent: Monday, January 02, 2006 8:45 PM
To: 'Jonathan Watt'; www-svg@w3.org
Subject: RE: Is the px unit equivalent to user units?


Hi, Jonathan-

Jonathan Watt wrote:
[...]
| 'One px unit is defined to be equal to one user unit. Thus, a 
| length of "5px" is the same as a length of "5".' 
[...]
| But a little further on you find the sentence: 'Note that use 
| of px units or any other absolute unit identifiers can cause 
| inconsistent visual results on different viewing environments 
| since the size of "1px" may map to a different 
| number of user units on different systems'.
| 
| How can you reconcile these statements? Is the latter 
| statement a mistake, or is there a reason for it? 

I think that it's a bit of a sticky thing to wrap one's head around. As
best
as I can make out, neither statement is not always correct. If you have
specified px units on an element, the size of the device screen in
combination with the initial viewBox and the zoom level will almost
certainly mean that the device pixels are not the actual measurement of
the
element's geometry. So, equating user units to pixels (or even using
pixels
as a unit) is almost certainly semantically wrong, and most likely
literally
wrong as well.

This may be a legacy from CSS's insistence on unit values, or a
carryover
from some earlier mechanism or scenario discussed in the SVG WG, but I
don't
think that they are particularly relevant to the current realities of
SVG.
In fact, I much prefer the way SVG Tiny 1.2 approaches the problem, by
moving all unit measurements to the root. The only place I see this
falling
down is in relative units such as percentages, em, and ex, which may
still
be useful. I would like to see the 'px' unit deprecated in SVG, in favor
of
'uu' (user units) or 'csu' (coordinate space units).

Would a real SVG WG member care to chime in?


| Is the advice I'm giving sound or not?

I would personally prefer the reverse advice, if it's practical. Since
SVG
Tiny 1.2 will not allow CSS units, it would be better to advise people
not
to use CSS at all, except possibly in the case of stylesheets (which you
do
state on your page).

Regards-
Doug

doug.schepers@vectoreal.com
www.vectoreal.com ...for scalable solutions.
 
Received on Tuesday, 3 January 2006 17:27:22 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:33 GMT