|
Posted by Peter Billam on October 25, 2007, 7:20 pm
Please log in for more thread options
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
|
| Similar Threads | Posted | | Tie::Persistent issues | May 11, 2005, 10:11 am |
| ANNOUNCE: OOPS 1.004 - Object Oriented Persistent Store | July 4, 2006, 1:53 pm |
| RFC: DBIx::Counter - persistent counter class | April 14, 2005, 3:15 am |
| Why is nothing found in @INC path ?!?! | April 21, 2006, 2:39 pm |
| CGI Cookie Path Question | December 26, 2005, 10:53 am |
| skip path prune | July 17, 2006, 12:34 pm |
| Graph Path Module | April 14, 2008, 5:37 am |
| Getting Path of an external DLL in Perl: Inline C. | October 2, 2005, 8:41 pm |
| XML::XSLT does not accept an absolute path | November 15, 2007, 5:02 pm |
| Customizing include path with CPAN install | November 22, 2004, 9:46 am |
|