In SVG, persistent signs in path ?

In SVG, persistent signs in path ?

am 26.10.2007 01:11:57 von Peter Billam

Greetings SVG folk. I've been exploring Ronan Oger's SVG module (with a
view to adding a -svg option to muscript) and, for example, the code for
a treble clef is:
my $g = $page->group(transform=>"translate($x,$y) scale($sh,$sh)");
$g->circle( cx=>-.17, cy=>-.479, r=>0.086, 'stroke-width'=>0 );
$g->path(d=>'M-.256,-.479 C-.256,-.58 -.17,-.643 -.12,-.643 L-.12,-.617 '
. 'C-.21,-.622 -.13,-.58 -.21,-.479', closed=>'true', 'stroke-width'=>0);
$g->path(d=>'M-.12,-.63 C+.07,-.63 +.11,-.48 +.10,-.4 L-0.05,+.75',
'fill-opacity'=>0, 'stroke-width'=>.026);
$g->path(d=>'M-.062,+.751 C-.1,+1.1 +.06,1.18 .10,1.10 L.125,1.12 '
. 'C+.06,1.09 -.084,+1.05 -.038,+.749', closed=>'true', 'stroke-width'=>0);
$g->path(d=>'M+.10,1.19 C.36,.55 -.27,+.45 -.27,+.10 L-.3,+.16 '
. 'C-.3,+.6 .25,.65 .125,1.12', closed=>'true', 'stroke-width'=>0);
$g->path(d=>'M-.3,+.16 C-.3,-.15 -.15,-.23 +.02,-.23 L+.02,-.21 '
. 'C-.15,-.21 -.27,-.15 -.27,+.10', closed=>'true', 'stroke-width'=>0);
$g->path(d=>'M+.02,-.23 C+.2,-.23 +.30,-.26 +.30,+.04 L+.256,+.04 '
. 'C+.27,-.11 +.2,-.21 +.02,-.21', closed=>'true', 'stroke-width'=>0);
$g->path(d=>'M+.30,+.04 C+.30,+.16 +.17,+.28 +.07,+.28 L+.07,+.19 '
. 'C+.17,+.19 +.26,+.16 +.265,+.04', closed=>'true', 'stroke-width'=>0);
$g->path(d=>'M+.07,+.28 C-.15,+.28 -.15,+.05 -.05,-.05 '
. 'C-.10,+.05 -.08,+.19 +.07,+.19', closed=>'true', 'stroke-width'=>0);

Notice that in all those Cubic-bezier paths I've had to specify an
explicit unary + sign in front of positive numbers. If I don't do this,
SVG seems to make the explicit sign of a previous number persistent
over all subsequent numbers in the path. So code like this, with
intermixed positive and negative numbers, needs a burdensome amount
of explicit unary + signs... Is that a bug, or a feature ?

Regards, Peter

--
AUS/TAS/DPIW/CIT/Servers hbt/lnd/l8 6233 3061 http://www.pjb.com.au
Pasaré, pasarémos dice el agua y canta la verdad contra la piedra
-- Pablo Neruda