Re: fancy lines

On Fri, 2013-01-04 at 00:45 -0600, Brenton Chapin wrote:
> Greetings list.  I dabble with SVG and am still trying to figure out
> what it can do.
> Stroke-dasharray allows the drawing of many kinds of dashed lines.  Is
> there any way to draw such things as a double line, tapered line, or a
> wavy line, with a single use of a path or line element? 

Not at the moment, hopefully in SVG 2.

> The SVG documentation says patterns can be used for strokes, but I
> haven't been able to get that to work.  There's an example of a
> pattern used for a fill, but no example for a stroke.

Patterns can be used for strokes but they probably won't do what you
want to do since the pattern will not be warped to follow the path.

> Another idea was <tspan dy="-1"> and <tspan dy="1"> for a double line,
> except tspan only works on text.
> Meantime, what does work for a double line is drawing a thin line in
> the background color on top of a thick line.

This is the best way at the moment. If you define a path without any
styling and then reference it with the <use> element multiple times, you
can build up more complex paths that will automatically adapt if the
referenced path is changed. This is essentially what is described in the
context of Inkscape at the bottom of:

Inkscape also has a number of ways of putting patterns along a path
which can give you a tapered or wavy line by replacing a simple path
with a more complex path.


Received on Monday, 7 January 2013 09:02:15 UTC