Re: units

> 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.

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.


Cameron McCormack
|  Web:
|  ICQ: 26955922

Received on Saturday, 17 July 2004 02:09:13 UTC