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

RE: Feature request for SVG2 : stroke-position

From: David Dailey <ddailey@zoominternet.net>
Date: Mon, 19 Sep 2011 18:10:07 -0400
To: "'Jeremie Patonnier'" <jeremie.patonnier@gmail.com>, <cabanier@gmail.com>
Cc: "'www-svg'" <www-svg@w3.org>
Message-ID: <001b01cc7718$e453f650$acfbe2f0$@net>
I like the general thrust of this discussion. A couple of things come to

Might it not be nice to allow multiple stroke offsets for the same path? ---
and then all of a sudden we are talking about vector effects again. 


If no one remembered to put important things from SVG1.2 (like vector
effects) into 2.0 then please don't forget them. All of the vector effects
had reasons for coming into existence. No, it is true that authors haven't
used them much yet , but this doesn't mean there is no interest. Sometimes
the way we assesses need in SVG reminds me of when I was employed to count
crazy people for the government of Alaska . I am respectful and will spare
you the details. (Ask me sometime, though; it is a fun story.)


This would be very useful for typographic effects like
http://srufaculty.sru.edu/david.dailey/svg/text/ particularly those like
http://srufaculty.sru.edu/david.dailey/svg/text/plastic6.svg  that involve





From: www-svg-request@w3.org [mailto:www-svg-request@w3.org] On Behalf Of
Jeremie Patonnier
Sent: Monday, September 19, 2011 4:54 PM
To: cabanier@gmail.com
Cc: www-svg
Subject: Re: Feature request for SVG2 : stroke-position


Thanks for your answers :)

2011/9/19 Rik Cabanier <cabanier@gmail.com>

What I meant to say:

fill rule will only work if the path segment will participate if the shape
is filled.

Are there some cases where it's possible to have a shape that cannot be
filled (note that to have the fill not visible does not mean that it's
impossible to fill the shape, a straight line is a good example of that
issue) ?

Simple lines or path segments that are filled on both sides are still

I guess you are talking about something like that :
<path d="M0,0 L0,100 L100,100 L100,0 M0,50 L100,50" />
In this case the M0,50 L100,50 segment is filled on both side, am I right ?

On Mon, Sep 19, 2011 at 9:50 AM, Rik Cabanier <cabanier@gmail.com> wrote:

this sounds like a reasonable feature.

Thanks, the intent is to provide an easy way for author to control the
position of the stroke. It's especially true when you use SVG on a browser
and try to have a pixel perfect shape.

The following looks blury in a browser (and the viewbox is not obvious) :

<svg width="12px" height="12px" viewbox="-1 -1 12 12">
    <rect x="0" y="0" width="10" height="10" stroke="black"
stroke-width="1px" fill="none" />

Where this is sharp (but the rect size is not obvious) :

<svg width="10px" height="10px" viewbox="0 0 10 10">
    <rect x="0.5" y="0.5" width="9" height="9" stroke="black"
stroke-width="1px" fill="none" />

for authors it would a lot more easier to understand (and to manipulate) to
have this :

<svg width="10px" height="10px" viewbox="0 0 10 10">
    <rect x="0" y="0" width="10" height="10" stroke="black"
stroke-width="1px" stroke-position="inside" fill="none" />

The <value> attribute will introduce significant complexities since it might
cause strokes to overlap each other 

I'm not sure to understand what you mean here. Can a shape have multiple
stroke ?
However, just having "middle", "outisde" and "inside" would be awesome

and it will make the stroke no longer match the fill.

Yes... and is it a problem ? In an author point of view, it's something that
could be wanted.
For example, this is something ok and stroke-position="<value>" could be an
easy way for author to achieve such an effect :


By writing that example, I think I realize what you mean by "it might cause
strokes to overlap each other". What happen if we have that path :

<path d="M0,0 L100,0 L60,50 L100,100 L0,100 L40,50 Z"
    fill="none" stroke="red" stroke-width="10"
    stroke-position="-20" />

Does it look like this (the black line materialize the true path) :


or like this : 


Well, both result are acceptable and, once again, it's up to the author. So,
to let him choose in here, it could be necessary to have another attribute :
stroke-overlap with two values : "show" to have the first case and "hide" to
have the second case. I vote to be "hide" the default value.


Web :  <http://jeremie.patonnier.net/> http://jeremie.patonnier.net
Twitter : @ <http://twitter.com/JeremiePat> JeremiePat

(image/png attachment: image001.png)

(image/png attachment: image002.png)

(image/png attachment: image003.png)

Received on Monday, 19 September 2011 22:10:49 GMT

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