W3C home > Mailing lists > Public > www-svg@w3.org > September 2011

Re: Feature request for SVG2 : stroke-position

From: Rik Cabanier <cabanier@gmail.com>
Date: Mon, 19 Sep 2011 09:50:19 -0700
Message-ID: <CAGN7qDDOOPBAwtuQ=XcdBjA6Fzf3N-bV9vv_81n6notj8vYHig@mail.gmail.com>
To: Jeremie Patonnier <jeremie.patonnier@gmail.com>
Cc: www-svg <www-svg@w3.org>
Hi Jeremie,

this sounds like a reasonable feature.
Having it depend on the fill rule will solve some issues, but will only work
if the shape will be filled.
The <value> attribute will introduce significant complexities since it might
cause strokes to overlap each other and it will make the stroke no longer
match the fill.

Has there ever been a proposal to do an Illustrator style offset path
effect?

Rik

On Mon, Sep 19, 2011 at 2:39 AM, Jeremie Patonnier <
jeremie.patonnier@gmail.com> wrote:

> Hello SVG WG,
>
> I don't remember if there is plan for this, but I wonder if it would be
> possible to have the following feature in SVG2 :
>
> An new attribute named "stroke-position" that allow author to specify the
> way stroke are positioned around a shape.
> This new attribute could have the following values :
>
>    - middle : the default value, it act as it is today
>    - inside : the rendered stroke is fully inside the shape
>    - outside : the rendered stroke is fully outside the shape
>    - <value> : the middle of the stroke is moved by the <value> to
>    be rendered. A positive value moved the stroke out of the shape where a
>    negative value move the stroke into the shape
>
> Here are some exemples with images to show the expect rendering (the black
> line is for demonstration purpose only) :
>
> <rect width="20" height="20" stroke="red" stroke-width="5"
> stroke-position="middle" />
> [image: stroke-position-middle.png]
>
> <rect width="20" height="20" stroke="red" stroke-width="5"
> stroke-position="inside" />
> [image: stroke-position-inside.png]
>
> <rect width="20" height="20" stroke="red" stroke-width="5"
> stroke-position="outside" />
> [image: stroke-position-outside.png]
>
> <rect width="20" height="20" stroke="red" stroke-width="5"
> stroke-position="1.5" />
> [image: stroke-position-positive-1.5.png]
>
> <rect width="20" height="20" stroke="red" stroke-width="5"
> stroke-position="-1.5" />
> [image: stroke-position-negative-1.5.png]
>
> I know that there is a question when the shape is not closed (where is the
> inside/outside of a line ?) In this case, it's possible to relay on the
> fill-rule attribute to determine this.
>
> Thanks :)
> --
> Jeremie
> .............................
> Web : http://jeremie.patonnier.net
> Twitter : @JeremiePat <http://twitter.com/JeremiePat>
>


stroke-position-negative-1.5.png
(image/png attachment: stroke-position-negative-1.5.png)

stroke-position-middle.png
(image/png attachment: stroke-position-middle.png)

stroke-position-positive-1.5.png
(image/png attachment: stroke-position-positive-1.5.png)

stroke-position-inside.png
(image/png attachment: stroke-position-inside.png)

stroke-position-outside.png
(image/png attachment: stroke-position-outside.png)

Received on Monday, 19 September 2011 16:50:47 GMT

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