W3C home > Mailing lists > Public > www-svg@w3.org > February 2012

Re: path data attribute lacks units!

From: Dr. Olaf Hoffmann <Dr.O.Hoffmann@gmx.de>
Date: Sun, 12 Feb 2012 14:31:39 +0100
To: www-svg@w3.org
Message-Id: <201202121431.39967.Dr.O.Hoffmann@gmx.de>
Brian Birtles;
>For example:
>
>   <svg width="3cm" height="4cm" viewBox="0 0 300 400">
>     <rect width="100" height="50"/>
>     <path d="M30 40.... " />
>   </svg>
>
>In this example, 1 SVG user unit will be scaled to 0.1mm. The user agent 
>will try to take care of the mapping between pixels and centimetres so 
>that the result is resolution independent.

In theory this is what is intended for SVG and what is correct, because
currently all SVG versions refer to CSS2.0 to define the meaning of
units like cm, mm or in. To use no units on other attributes or properties
than width and height of the root svg element simplifies things a lot and
ensures, that the relative sizes of objects are simple to predict.

However, unfortunately in CSS2.1 such absolute units as well as px
are intentionally obfuscated - and with typical user agents one will
not get 3cm if you write 3cm - such user agents simply fail, what is
documented with the obfuscation of units in CSS2.1.

Therefore in practice one can create such documents with a defined
size and they are ok, but with typical user agents they will be displayed 
wrong - and there is no work around for this problem.

If one day the SVG decides to refer to CSS2.1 instead of CSS2.0 
concerning units, one cannot even write documents with a defined size
anymore in new versions of SVG.

My conclusion is, that practically already now SVG is not useful for
applications, that require that the graphics is displayed in a specific
and predictable size, this option is completely corrupted.

Olaf
Received on Sunday, 12 February 2012 13:32:13 GMT

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