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

Re: Transformations with units

From: Dirk Schulze <dschulze@adobe.com>
Date: Sat, 3 Mar 2012 11:21:48 -0800
To: Rik Cabanier <cabanier@gmail.com>
CC: "Dr. Olaf Hoffmann" <Dr.O.Hoffmann@gmx.de>, "www-svg@w3.org" <www-svg@w3.org>
Message-ID: <D313B634-032E-4D00-9B43-33EEEEA81EEA@adobe.com>


On Mar 3, 2012, at 10:48 AM, "Rik Cabanier" <cabanier@gmail.com<mailto:cabanier@gmail.com>> wrote:



On Sat, Mar 3, 2012 at 7:21 AM, Dirk Schulze <dschulze@adobe.com<mailto:dschulze@adobe.com>> wrote:

On Mar 3, 2012, at 5:45 AM, Dr. Olaf Hoffmann wrote:

> Tanguy Ortolo:
>
>> Well, I guess natural units would not have a very high popularity then,
>> most SVG drawings must be using pixels…
With the merged transformation spec CSS3 Transforms[1], you can use units like cm, in, px, pt and a lot more for translate(). But all units are relative to user units which means the same like Olaf mentions in his post.

Can you use unitl if you express the transform with 'style: transform(...)' or also directly with the transform attribute?
Read section "The SVG 'attribute'" in the previous linked spec. The transform attribute will turn into a presentation attribute. Therefore you will be able to set the CSS transform by the SVG attribute as well. For backward compatibility the attribute will merge the parsing rules of SVG and CSS and will also support transformation functions of both, CSS3 Transforms and SVG.

Beside the transform attribute new presentation attributes will be introduced that match the new properties in the CSS3 Transforms specification like 'transform-origin'.

Dirk




>
> Without providing a unit or an option to do so, you work in local units.
> Typically these are no pixels. Apart from other transformations,
> how much this is, depends mainly on the relation of width, height, viewBox
> and preserveAspectRatio especially on the root svg element.
> The simplest approach is anyway just to use only local units within the
> svg element and define width and height of the svg with the intended
> units.
> Whatever you assume, what a 'natural unit' is, as already discussed before,
> there are reasons, why you will typically get the absolute units like mm and
> cm not correctly displayed, if you use them ...
>
>
> Olaf
>


Dirk

[1] http://dev.w3.org/csswg/css3-transforms/


Received on Saturday, 3 March 2012 19:22:23 GMT

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