W3C home > Mailing lists > Public > www-svg@w3.org > July 2004

Re: units

From: MenTaLguY <mental@rydia.net>
Date: Sun, 18 Jul 2004 01:23:44 -0400
To: SVG List <www-svg@w3.org>
Cc: bulia byak <buliabyak@gmail.com>
Message-Id: <1090128223.14231.21.camel@cato.moonbase>
On Sat, 2004-07-17 at 02:08, Cameron McCormack wrote:
> MenTaLguY:
> > On Wed, 2004-07-14 at 00:22, Cameron McCormack wrote:
> > 
> > >   <svg width="100pt" height="100pt">
> > >     <rect x="25pt" y="25pt" width="50pt" height="25pt" fill="red"/>
> > >     <svg viewBox="0 0 100 100">
> > >       <path d="M25,50L75,50L75,75L25,75L25,50z" fill="blue"/>
> > >     </svg>
> > >   </svg>
> > 
> > 
> > What if I wanted to specify the path's stroke width in pt?
> 
> Since you know that the viewBox has transformed the space into 1 user
> unit = 1 pt, you could just have stroke-width="1".

> A trickier case
> would be if you want to specify the stroke-width in another unit, like
> em.  I don't see a solution to that, aside from using script to
> determine the equivalent value in user units.

It's also a problem if I want to take the stroke width from a
stylesheet, which doesn't intrinsically "know" the user unit/pt
relationship for all the elements the rule applies to.

> A more complete solution would be to modify the path syntax to allow
> units.  That might make the path data parser more complex, which I guess
> is something the WG try to avoid.

I think just the addition of an additional attribute to indicate path
units would have sufficed in most cases.

As it is, for general use this one misfeature of SVG renders all units
but user units useless.  I woul dbe interested in learning the rationale
behind the decision.

-mental

Received on Sunday, 18 July 2004 01:23:49 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 07:14:54 UTC