Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

import 2.50 from CPAN

  • Loading branch information...
commit 39c980268c68924d26606a006a11f9eb0ea8621e 0 parents
@szabgab authored
Showing with 7,293 additions and 0 deletions.
  1. +207 −0 Changes
  2. +2 −0  LICENSE
  3. +50 −0 MANIFEST
  4. +22 −0 META.yml
  5. +12 −0 Makefile.PL
  6. +143 −0 README
  7. +49 −0 examples/SVG_02_sample.pl
  8. +35 −0 examples/attributeManip.pl
  9. +58 −0 examples/image_sample.pl
  10. +55 −0 examples/inline_sample.pl
  11. +236 −0 examples/inlinesvg.pl
  12. +22 −0 examples/minsvg.pl
  13. +25 −0 examples/starpath.cgi
  14. +387 −0 examples/sun_text_sample.pl
  15. +27 −0 examples/svg.pl
  16. +147 −0 examples/svg_dom_sample.pl
  17. +237 −0 examples/svgtest2.pl
  18. +417 −0 examples/yaph5.cgi
  19. +341 −0 lib/SVG.pm
  20. +804 −0 lib/SVG/DOM.pm
  21. +1,649 −0 lib/SVG/Element.pm
  22. +458 −0 lib/SVG/Extension.pm
  23. +1,202 −0 lib/SVG/Manual.pm
  24. +185 −0 lib/SVG/XML.pm
  25. +4 −0 t/01-loadsvg.t
  26. +4 −0 t/02-simpledoc.t
  27. +9 −0 t/03-render.t
  28. +27 −0 t/04-inline.t
  29. +27 −0 t/05-processinginstruction.t
  30. +32 −0 t/06-doctype.t
  31. +9 −0 t/07-extension.t
  32. +12 −0 t/08-looknfeel.t
  33. +61 −0 t/09-script.t
  34. +17 −0 t/10-autoload.t
  35. +13 −0 t/11-customtags.t
  36. +9 −0 t/12-elementid.t
  37. +20 −0 t/13-duplicateids.t
  38. +14 −0 t/14-attributes.t
  39. +34 −0 t/15-parentage.t
  40. +15 −0 t/16-siblings.t
  41. +15 −0 t/17-tagtypes.t
  42. +24 −0 t/18-filter.t
  43. +13 −0 t/19-style.t
  44. +55 −0 t/20-anchor.t
  45. +35 −0 t/21-polygon.t
  46. +14 −0 t/22-xlink.t
  47. +41 −0 t/23-xmlescape.t
  48. +6 −0 t/24-doubleuse.t
  49. +7 −0 t/98_all_pod.t
  50. +6 −0 t/99_test_pod_coverage.t
207 Changes
@@ -0,0 +1,207 @@
+Revision history for Perl extension SVG.
+
+2.50 05 April, 2010
+ -Fixed inline SVG generation method (bug # 43814 and 50075)
+ -Fixed XML-escaped characters (bug # 53918 and 44454)
+ -Fixed undef bug in findChildIndex (bug # 48932)
+ -Fixed memory leaks with Scalar::Util::weaken() (bug # 54458)
+ -Fixed cloning method (bug # 36194)
+ -DOM::insertAtIndex() and removeAtIndex() now update the ID and element list
+
+2.49 23 January, 2009
+ -Fixed bugtracker URL in YAML
+
+2.48 08 January, 2009
+ -Improved YAML and MANIFEST for cpan testers game
+
+2.47 15 December, 2008
+ -Fixed MANIFEST - replaced Changes entry
+
+2.46 15 December, 2008
+ -Improved META.yml
+ -Fixed MANIFEST
+ -Removed all pointless files
+
+2.45 15 December, 2008
+ -Improved META.yml
+
+2.44 21 April, 2008
+ -Improved META.yml
+
+2.43 21 April, 2008
+ -Improved META.yml
+
+2.42 16 April, 2008
+ -Removed Makefile from MANIFEST
+
+2.41 16 April, 2008
+ -Fixed MANIFEST and added license data to the SVG.pm file
+
+2.40 14 April, 2008
+ -Changed tests to current recommendation. Moved to t/ directory.
+ -Added POD and POD Coverage tests
+
+2.39 08 April, 2008
+ -Added warnings
+
+2.38 03 April, 2008
+
+ -Modified SVG::Element to answer a bug report in rt.perl.org by slaven
+ regarding the redefined methods warnings when SVG is used twice.
+ -Fixed the POD to reflect annotation comments.
+
+2.37 02 March, 2008
+ -Added NS definitions for svg and xlink to enable xlink:href and svg: namespace usage in Firefox.
+
+2.36 16 September, 2007
+ -Fixed SVG::DOM POD
+
+2.35 14 September, 2007
+ -Fixed SVG::DOM POD
+
+2.34 17 May 2005
+ -SVG::Element - Removed elsep entry for CDATA, cdata, cdata_noxmlesc fields to get rid of
+ artificial blank spaces that confuse some browsers
+ -SVG::DOM - added getRootNode method
+ -Added user-contributed DOM2 methods to SVG::DOM
+
+2.33 14 May, 2005
+ -fixed the xlink reference behaviour which was wrong and
+ broke Mozilla native SVG. Fix submitted by Ian Hickson
+
+2.32 10 October, 2004
+ -bufgix to repair broken test which causes failure of make test
+ -added sorting to attribute list so output is consistent
+ -added generic support for -href for any method that adds
+ it as an attribute
+ -added xlink support to any tag with an -href attribute
+ -added 'a' and 'g' autosubs
+ -added numerous tests including pi, polygon, script, anchor, style tests
+ -bugfix for pi() method
+ -repaired script and style examples
+
+2.31 8 October, 2004
+ -bugfix to stop xml escaping of attribute data.
+ -additional support of making fe element types case insensitive
+
+2.30 30 Sept, 2004
+ -POD changes
+
+2.29 26 September, 2004
+ -exposed SVG::Extension
+ -exposed perlify
+ -added Mozilla native SVG support as default behaviour
+
+2.28 Monday 3 November, 2003 (RO, PW)
+ -Added SVG::GD to allow GD users to output SVG for simple GD drawings (RO)
+ -Added perlify support: Generate Perl code from an SVG document (PW)
+ -Added SVG::Extention for DTD validation support during serialisation (PW)
+ -Took away automatic xml escaping code. This belongs in user codei (RO).
+ -Added attributeName and attributeType to legal animateTransform in
+ SVG::Element SMIL animation per Mike Churchill bug report 2003.12.03
+ -bug fix to the inlinesvg.pl example Also per Mike Churchill bug report
+
+2.27 Wednesday 29 January 2002 (RO)
+ -Added setAttribute and setAttributes to SVG::DOM
+
+2.26 Sunday 4 August 2002 (PW)
+ - Moved all -specialarguments to %default_attrs so they
+ can be set at import time
+ - Added strict checking for duplicate IDs in tag() and attribute()
+ - Created test suite of 17 initial regession test scripts
+ - Improved xmlesc method in
+
+2.25 Sunday 13 July 2002 (PW)
+ - Extended DOM module to cover many more DOM functions
+ - Rewrote attrib() to also set and delete attributes
+ - Added 'attribute' and 'attr' aliases for attrib()
+
+2.22 Monday 24 June 2002
+ - Minor bug fix - method script was changed to uppercase accidentally.
+ Repaired this error.
+
+2.21 Thursday 20 June 2002
+ - Added the internal hash $svg->{-docref} which contains
+ the -elist and -idlist hashes for tracking the elements
+ and ids in the document in the DOM
+ - Added functionality to SVG::DOM including getElements, getElementByID
+ - Added an example of the use of SVG DOM in the examples directory
+ - Added element-level namespace support to override the document namespace
+
+
+2.2 (Not released) Friday 15 June 2002
+ - Bug fix for SVG::DOM
+ - Enabled SVG::DOM and added additional functionality
+
+2.1 27 May 2002
+ - Separated out the SVG module documentation and moved it to SVG::Manual.pm
+ - Added experimental SVG::DOM
+ - Improved script support and commenting.
+ - Added an end-of-output credit
+
+2.0 Mon Dec 24 14:00
+ - Improved POD, and moved it to SVG::manual
+ - Tested significantly
+ - Added aliases for xmlify
+ - broke out Element.pm module from SVG.pm file
+ - Repaired scripting support
+ - Added CDATA tag for unmollested text support
+ - changed underlying datastructure to support SVG::Parser
+ - Repaired inline SVG generation
+ - Added configurability and NON-SVG support
+
+1.12 Thu Oct 18 00:25
+ - Repaired Animate command
+ - Added import functionality
+ - Improved AUTOLOAD functionality
+ - Improved POD
+ - Tested significantly
+ - Modified constructor to accept XML-definition parameters
+ in preparation for supporting SVG::Parser
+
+0.60-1.0 Internal releases
+ - Not released to public.
+
+0.50 Sat Oct 13 12:00
+ - Maintenance release.
+ - Repaired and added consistency to pod
+ - Repaired small bug in inline.
+ - Added svg.pm to examples. Tested sample of the synopsis script.
+
+0.31 Thu Oct 10 12:00:00
+ - Bug fix for careless error. Left a debugging comment in the code.
+ - Next time, run the code through an interpreted rather than just
+ looking at the raw XML.
+
+0.30 Wed Oct 10 17:05:00
+ - Now support -T and inline and namespace.
+
+0.29 Tue Oct 9 14:36:00
+ - Repaired bug in method $self->use(). The method was
+ generating an <image > tag.
+
+0.28 Mon Oct 8 18:05:40
+ - Got the program to pass -w
+ - Fixed user-reported bug in animate function $rtr{-method}
+ was missing the minus.
+ - ran significant tests for complex files. Most work but some crash.
+
+0.26 Sun Oct 7 00:40:00
+ - Repaired the pod file
+ - Added title and desc support
+
+0.25 Sat Oct 6 23:00:02
+ - added image support; improved POD;
+ - Provided DTD & XML version support:
+ XML version '1.0'
+ XML encoding 'UTF-8'
+ standalone 'yes'
+ namespace 'svg'
+ DTD identifier '-//W3C//DTD SVG 1.0//EN';
+ DTD url 'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd'
+
+0.2 Sat Oct 6 02:47:02
+ - added filter support; improved POD.
+
+0.1 Thu Oct 4 09:46:28 2001
+ - original version; created by h2xs 1.19
2  LICENSE
@@ -0,0 +1,2 @@
+The modules in the SVG distribution are distributed under the same license as Perl itself. It is provided free of warranty and may be re-used freely.
+
50 MANIFEST
@@ -0,0 +1,50 @@
+META.yml
+examples/attributeManip.pl
+examples/image_sample.pl
+examples/inline_sample.pl
+examples/inlinesvg.pl
+examples/minsvg.pl
+examples/starpath.cgi
+examples/sun_text_sample.pl
+examples/svg.pl
+examples/SVG_02_sample.pl
+examples/svg_dom_sample.pl
+examples/svgtest2.pl
+examples/yaph5.cgi
+lib/SVG.pm
+lib/SVG/DOM.pm
+lib/SVG/Element.pm
+lib/SVG/Extension.pm
+lib/SVG/Manual.pm
+lib/SVG/XML.pm
+LICENSE
+Makefile.PL
+MANIFEST
+README
+Changes
+t/01-loadsvg.t
+t/02-simpledoc.t
+t/03-render.t
+t/04-inline.t
+t/05-processinginstruction.t
+t/06-doctype.t
+t/07-extension.t
+t/08-looknfeel.t
+t/09-script.t
+t/10-autoload.t
+t/11-customtags.t
+t/12-elementid.t
+t/13-duplicateids.t
+t/14-attributes.t
+t/15-parentage.t
+t/16-siblings.t
+t/17-tagtypes.t
+t/18-filter.t
+t/19-style.t
+t/20-anchor.t
+t/21-polygon.t
+t/22-xlink.t
+t/23-xmlescape.t
+t/24-doubleuse.t
+t/98_all_pod.t
+t/99_test_pod_coverage.t
22 META.yml
@@ -0,0 +1,22 @@
+--- #YAML:1.0
+name: SVG
+version: 2.50
+abstract: Perl extension for generating Scalable Vector Graphics (SVG) documents
+author:
+ - Ronan Oger <ronan@cpan.com>
+license: perl
+distribution_type: module
+configure_requires:
+ ExtUtils::MakeMaker: 0
+build_requires:
+ ExtUtils::MakeMaker: 0
+requires:
+ Scalar::Util: ~
+no_index:
+ directory:
+ - t
+ - inc
+generated_by: ExtUtils::MakeMaker version 6.55_02
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
12 Makefile.PL
@@ -0,0 +1,12 @@
+use ExtUtils::MakeMaker;
+# See lib/ExtUtils/MakeMaker.pm for details of how to influence
+# the contents of the Makefile that is written.
+WriteMakefile(
+ NAME => 'SVG',
+ VERSION_FROM => 'lib/SVG.pm', # finds $VERSION
+ PREREQ_PM => { 'Scalar::Util' },
+ ($] >= 5.005 ? ## Add these new keywords supported since 5.005
+ (ABSTRACT_FROM => 'lib/SVG/Manual.pm', # retrieve abstract from module
+ LICENSE => 'perl',
+ AUTHOR => 'Ronan Oger <ronan@cpan.com>') : ()),
+);
143 README
@@ -0,0 +1,143 @@
+README for SVG.pm
+
+SVG.pm is a perl extention to generate standalone or inline SVG
+(scaleable vector graphics) images using the W3C SVG xml recommendation.
+
+Refer to the pod for full documentation and an example script,
+or to the following mirrors:
+
+1/ http://search.cpan.org/perldoc?SVG
+2/ http://search.cpan.org/~ronan
+
+The complete pod for SVG resides in SVG::Manual
+type perldoc SVG::Manual on the command line
+
+(c) 2001-2008 Ronan Oger, RO IT Systems, GmbH
+homepage: http://www.roitsystems.com
+
+CONTACT POINT
+-------------
+
+ronan@cpan.org
+
+This software is provided as is and without warranty.
+It is freely distributed under the general perl license.
+
+LICENSE
+-------
+
+This software is provided under the terms of the Perl license
+
+OVERVIEW
+--------
+SVG.pm makes it possible to generate fully-functional SVG images in perl.
+100% of the SVG tags are supported, and any new arbitrary element tag can be
+added by users by declaring it.
+
+VERSION
+-------
+2.33 Sunday, 2005.05.15
+
+DOCUMENTATION
+-------------
+The following documentation is available:
+POD in HTML format
+pod in perldoc format (type perldoc SVG on command line)
+
+RESOURCES
+---------
+The following URLs offer additional resources for users of SVG.pm:
+* Serverside Perl Forum: http://www.roitsystems.com/serverside/
+* SVG.pm on-line manual http://www.roitsystems.com/man/SVG.html
+* Perl SVG tutorials http://www.roitsystems.com/tutorial/
+* Perl SVG Zone homepage http://www.roitsystems.com/
+* gallery of the use of SVG.pm on the web http://roitsystems.com/gallery/svg/index.html
+* SVG Foundation http://www.svgfoundation.org
+* SVG Developers mailing list http://www.yahoogroups.com/svg-developers/
+* W3 Consortium http://www.w3.org
+* Sams Publishing, "SVG Unleashed", September 2002. There is a Perl chapter
+* SVG Open Conference proceedings http://www.svgopen.org
+* SVG foundation http://www.svgfoundation.org
+* SVG dot org http://www.svg.org
+INSTALLATION INSTRUCTIONS
+-------------------------
+***THERE ARE FIVE WAYS TO IMPLEMENT SVG MODULE IN PERL***
+
+ 1/ Systems with CPAN support (all Unix/Linux/BSD/Mac):
+ -----------------------------------------------------
+ Install the new distribution via the Perl CPAN module:
+ In a shell:
+ /home/somewhere% perl -MCPAN -e"install SVG"
+
+ 2/ (WIN) install Perl from Active State or equivalent:
+ -----------------------------------------------------
+ Make sure you already have perl or get it here: http://www.activestate.com
+ On the command line:
+ C:\> ppm
+ PPM> set repository tmp http://roitsystems.com/PPM/SVG/
+ PPM> install SVG
+ PPM> quit
+ C:\>
+
+ 3/ Use Source RPMs.
+ Download the source RPM of your choice.
+ In a shell:
+ /hom/somewhere/% rpm -ihv SVG-source-rpm-name
+ You may be prompted for the root password
+
+ 4/ The hard way (requires make or nmake, tar, gunzip, and gcc):
+ ---------------------------------------------------------------
+ This method was tested in DOS, Windows, AS400, Linux, Unix, BSD, Mac.
+ Hard-headed users can directly get the distribution from
+ http://www.roitsystems.com/PPM/SVG/SVG-2.27.tar.gz or
+ http://www.roitsystems.com/PPM/SVG/ .
+ First download the source.
+ Then, in a shell:
+ /home/somewhere% gunzip SVG-2.27.tar.gz
+ /home/somewhere% tar-xvf SVG-2.27.tar
+ cd SVG-2.1
+ make
+ make test
+ make install
+
+
+ 5/ If all the above fail, there is still a (cumbersome) way:
+ -----------------------------------------------------------
+ You have to install to a local dirctory and explicitly call the module
+ by using one of the following line in your calling program:
+
+ #using use lib
+ use lib 'path/where/the/release/is/located';
+
+ -or-
+
+ #using BEGIN block at the beginning of the file
+ BEGIN {
+ push @INC 'path/to/svg.pm-file'; #where the SVG.pm file lives
+ push @INC 'path/to/svg.pm-file/SVG'; # where the Utils.pm file lives
+ }
+ #Refer to the Perl manual for more details.
+
+
+KNOWN BUGS & ISSUES
+-------------------
+Comments tags before the <svg> element are toxic. This is being worked on but I can not promise anything.
+
+Please submit bug reports to http://rt.cpan.org
+
+SEE ALSO
+--------
+SVG::Parser
+SVG::DOM
+SVG::XML
+SVG::Element
+
+CHANGE LOG
+----------
+You can find details about the changes over time in the change log file: Changes
+
+COMMENTS/FEEDBACK
+-----------------
+Please email your feedback, comments, questions to the email address at the top
+of this document. I will do my best to answer promptly. To date, I have not
+knowingly failed to answer any emails.
49 examples/SVG_02_sample.pl
@@ -0,0 +1,49 @@
+#!/usr/bin/perl
+
+BEGIN {
+ push @INC , '../';
+ push @INC , '../SVG';
+}
+
+ use SVG;
+ use strict;
+ use CGI ':new :header';
+ my $p = CGI->new;
+ $| = 1;
+
+ my $svg= SVG->new(width=>200,height=>200);
+
+ my $y=$svg->group( id => 'group_y',
+ style => {stroke=>'red', fill=>'green'} );
+
+ my $z=$svg->tag('g', id=>'group_z',
+ style=>{ stroke=>'rgb(100,200,50)',
+ fill=>'rgb(10,100,150)'} );
+
+
+ $y->circle(cx=>100,
+ cy=>100,
+ r=>50,
+ id=>'circle_y',);
+
+ $z->tag('circle',cx=>50,
+ cy=>50,
+ r=>100,
+ id=>'circle_z',);
+
+ # an anchor with a rectangle within group within group z
+
+ my $k = $z -> anchor(
+ -href => 'http://test.hackmare.com/',
+ -target => 'new_window_0') ->
+ rectangle ( x=>20,
+ y=>50,
+ width=>20,
+ height=>30,
+ rx=>10,
+ ry=>5,
+ id=>'rect_z',);
+
+
+ print $p->header('image/svg-xml');
+ print $svg->xmlify;
35 examples/attributeManip.pl
@@ -0,0 +1,35 @@
+#!/usr/bin/perl -w
+#
+# Attribute manipulations
+#
+use strict;
+use SVG;
+# create an SVG object
+#(c) 2003 Ronan Oger
+
+my $svg= SVG->new(width=>200,height=>200);
+
+$svg->title()->cdata('I am a title');
+
+# use explicit element constructor to generate a group element
+
+my $y=$svg->group(
+ id => 'group_y',
+ style => { stroke=>'red', fill=>'green' }
+);
+
+$y->circle(cx=>100, cy=>100, r=>50, id=>'circle_in_group_y_1');
+# add a circle to the group
+$y->circle(cx=>100, cy=>100, r=>50, id=>'circle_in_group_y_2');
+$y->comment('This is a comment');
+$y->circle(cx=>100, cy=>100, r=>50, id=>'circle_in_group_y_3');
+# now render the SVG object, implicitly use svg namespace
+print "\nfirst drawing\n";
+print $svg->xmlify;
+print "\n\nSet stroke to red on circle_in_group_y_1\n";
+my $node = $y->getElementByID('circle_in_group_y_1');
+$node->setAttribute('stroke','red');
+print $svg->xmlify;
+print "\n\nSet stroke to green and undef the cx on circle_in_group_y_1\n";
+$node->setAttributes({'stroke'=>'green',cx=>undef});
+print $svg->xmlify;
58 examples/image_sample.pl
@@ -0,0 +1,58 @@
+#!/usr/bin/perl
+
+
+#
+# Incorporating an SVG image into another SVG image as an image object.
+#
+#
+
+BEGIN {
+ push @INC , '../';
+ push @INC , '../SVG';
+}
+
+ use SVG;
+ use strict;
+ use CGI ':new :header';
+ my $p = CGI->new;
+ $| = 1;
+
+ my $svg = SVG->new(width=>800,height=>400);
+
+ $svg->desc( id=>'root-desc')->cdata('hello this is a description');
+
+ $svg->title( id=>'root-title')->cdata('Dynamic SVG - Image usage within SVG using Perl');
+
+ #use another SVG component as an image inside our image
+
+ $svg->image(id=>'image_1',
+ -href=>'SVG_02_sample.pl',
+ x=>150,
+ y=>150,
+ width=>100,
+ height=>100);
+
+
+
+ #create a link to an other site through a png image
+ #We must first generate an anchor tag, give it agroup as a child,
+ #and put the image as a child in it.
+
+ $svg->anchor('-href'=>"http://www.hackmare.com/",target=>'new_window')
+ ->group(id=>'png_group')
+ ->image(id=>'image_2',
+ -href=>'http://www.hackmare.com/icons/logo/hackmaresplash600_1.png',
+ x=>10,
+ y=>10,
+ width=>600,
+ height=>94,);
+
+ $svg->text(x=>20,y=>280)->cdata('EXPLANATION');
+ $svg->text(x=>20,y=>310)->cdata('One image is imported as a full SVG image');
+ $svg->text(x=>20,y=>325)->cdata('The second (hackmare) image is imported is an .png image');
+ $svg->text(x=>20,y=>340)->cdata('Notice that the hackmare image contains a url anchor');
+ $svg->text(x=>20,y=>355,style=>{fill=>'red'})->cdata('Actually, the link anchor contains a group which contains the image');
+ $svg->text(x=>200,y=>385,style=>{fill=>'red','fill-opacity'=>0.2})->cdata("This image was generated with perl using Ronan Oger's SVG module");
+ print $p->header('image/svg-xml');
+
+ print $svg->xmlify;
55 examples/inline_sample.pl
@@ -0,0 +1,55 @@
+#!/usr/bin/perl -w
+
+
+#
+# Incorporating an SVG image into another SVG image as an image object.
+#
+#
+
+BEGIN {
+ push @INC , '../';
+ push @INC , '../SVG';
+}
+
+ use SVG;
+ use strict;
+
+ my $svg = SVG->new(width=>800,height=>400,);
+
+ $svg->desc( id=>'root-desc')->cdata('hello this is a description');
+
+ $svg->title( id=>'root-title')->cdata('Dynamic SVG - Image usage within SVG using Perl');
+
+ #use another SVG component as an image inside our image
+
+ $svg->image(id=>'image_1',
+ -href=>'SVG_02_sample.pl',
+ x=>150,
+ y=>150,
+ width=>100,
+ height=>100);
+
+
+
+ #create a link to an other site through a png image
+ #We must first generate an anchor tag, give it agroup as a child,
+ #and put the image as a child in it.
+
+ $svg->anchor('-href'=>"http://www.hackmare.com/",target=>'new_window')
+ ->group(id=>'png_group')
+ ->image(id=>'image_2',
+ -href=>'http://www.hackmare.com/icons/logo/hackmaresplash600_1.png',
+ x=>10,
+ y=>10,
+ width=>600,
+ height=>94,);
+
+ $svg->text(x=>20,y=>280)->cdata('EXPLANATION');
+ $svg->text(x=>20,y=>310)->cdata('One image is imported as a full SVG image');
+ $svg->text(x=>20,y=>325)->cdata('The second (hackmare) image is imported is an .png image');
+ $svg->text(x=>20,y=>340)->cdata('Notice that the hackmare image contains a url anchor');
+ $svg->text(x=>20,y=>355,style=>{fill=>'red'})->cdata('Actually, the link anchor contains a group which contains the image');
+ $svg->text(x=>200,y=>385,style=>{fill=>'red','fill-opacity'=>0.2})->cdata("This image was generated with perl using Ronan Oger's SVG module");
+
+
+ print $svg->xmlify(namespace=>'abc',);
236 examples/inlinesvg.pl
@@ -0,0 +1,236 @@
+#!/usr/bin/perl -w
+
+use strict;
+use CGI;
+
+BEGIN {
+ push @INC , '../';
+ push @INC , '../SVG';
+}
+
+use SVG;
+
+my $VERSION = 3;
+
+#---------Create the CGI object which is required to handle the header
+my $p = CGI->new();
+
+$| = 1;
+
+
+#---------print the header just before outputting to screen
+
+
+
+
+#---------
+
+#---------Create the svg object
+
+my $height = $p->param('h') || 400;
+my $width = $p->param('w') || 800;
+
+my $svg= SVG->new(width=>$width,height=>$height,-inline=>1,
+ -namespace=>'abc');
+
+my $y=$svg->group( id=>'group_generated_group',style=>{ stroke=>'red', fill=>'green' });
+
+my $z=$svg->tag('g', id=>'tag_generated_group',style=>{ stroke=>'red', fill=>'black' });
+
+
+my $ya = $y -> anchor(
+ -href => 'http://somewhere.org/some/line.html',
+ -target => 'new_window_0');
+
+
+my $line_transform = 'matrix(0.774447 0.760459 0 0.924674 357.792 -428.792)';
+
+my $line = $svg->line(id=>'l1',x1=>(rand()*$width+5),
+ y1=>(rand()*$height+5),
+ x2=>(rand()*$width-5),
+ y2=>(rand()*$height-5),
+ style=>&obj_style,);
+
+#---------
+foreach (1..&round_up(rand(20))) {
+ my $myX = $width-rand(2*$width);
+ my $myY = $height-rand(2*$height);
+
+ my $rect = $y->rectangle (x=>$width/2,
+ y=>$height/2,
+ width=>(50+50*rand()),
+ height=>(50+50*rand()),
+ rx=>20*rand(),
+ ry=>20*rand(),
+ id=>'rect_1',
+ style=>&obj_style);
+
+ $rect->animate(attributeName=>'transform',
+ attributeType=>'XML',
+ from=>'0 0',
+ to=>$myX.' '.$myY,
+ dur=>&round_up(rand(20),2).'s',
+ repeatCount=>&round_up(rand(30)),
+ restart=>'always',
+ -method=>'Transform',);
+}
+my $a = $z -> anchor(
+ -href => 'http://somewhere.org/some/other/page.html',
+ -target => 'new_window_0',
+ id=>'anchor a');
+
+my $a1 = $z -> anchor(
+ -href => '/index.html',
+ -target => 'new_window_1',
+ id=>'anchor a1');
+
+my $a2 = $z -> anchor(
+ -href => '/svg/index.html',
+ -target => 'new_window_2',
+ id=>'anchor a2');
+
+#---------
+
+my $c;
+foreach (1..&round_up(rand(5))) {
+
+ $c= $a->circle(cx=>($width-20)*rand(),
+ cy=>($height-20)*rand(),
+ r=>100*rand(),
+ id=>'c1',
+ style=>&obj_style);
+
+ $c = $a1->circle(cx=>($width-20)*rand(),
+ cy=>($height-20)*rand(),
+ r=>100*rand(),
+ id=>'c2',
+ style=>&obj_style);
+}
+#---------
+
+my $xv = [$width*rand(), $width*rand(), $width*rand(), $width*rand()];
+
+my $yv = [$height*rand(), $height*rand(), $height*rand() ,$height*rand()];
+
+my $points = $a->get_path(x=>$xv,
+ y=>$yv,
+ -type=>'polyline',
+ -closed=>'true',);
+
+
+$c = $a1->polyline (%$points,
+ id=>'pline1',
+ style=>&obj_style);
+
+#---------
+
+$xv = [$width*rand(), $width*rand(), $width*rand(), $width*rand()];
+
+$yv = [$height*rand(), $height*rand(), $height*rand() ,$height*rand()];
+
+$points = $a->get_path(x=>$xv,
+ y=>$yv,
+ -type=>'polygon',);
+
+
+$c = $a->polygon (%$points,
+ id=>'pgon1',
+ style=>&obj_style);
+#---------
+
+
+my $t=$a2->text(id=>'t1',
+ transform=>'rotate(-45)',
+ style=>&text_style);
+#---------
+
+
+my $u=$a2->text(id=>'t3',
+ x=>$width/2*rand(),
+ y=>($height-80)*rand(),
+ transform=>'rotate('.(-2.5*5*rand()).')',
+ style=>&text_style);
+
+
+
+my $v=$a2->tag('text',
+ id=>'t5',
+ x=>$width/2*rand(),
+ y=>$height-40+5*rand(),
+ transform=>'rotate('.(-2.5*5*rand()).')',
+ style=>&text_style);
+
+my $w=$a2->text(id=>'t5',
+ x=>$width/2*rand(),
+ y=>$height-20+5*rand(),
+ transform=>'rotate('.(-2.5*5*rand()).')',
+ style=>&text_style);
+
+
+$t->cdata('Text generated using the high-level "text" tag');
+$t->cdata('Courtesy of RO IT Systems GmbH');
+$v->cdata('Text generated using the low-level "tag" tag');
+$w->cdata('But what about inline SVG? Yes, we do that too');
+$w->cdata('All this with SVG.pm? Wow.');
+
+print $p->header('image/svg-xml');
+print $svg->render(-inline=>1);
+
+exit;
+
+
+#################
+# Subroutine to round up the value of a number or of a text representation of number
+#
+sub round_up {
+ my ($x, $precision) = shift;
+ $x =~ s/^\s+//g;
+ $x =~ s/\s+$//g;
+ $x =~ s/,//g;
+
+ my $y;
+ $precision = 0 unless $precision;
+ ($x, $y) = split( /\./, $x) if $x =~ /\./;
+ my $y1 = substr($y, 0, $precision);
+ my $y2 = substr($y, $precision, 1);
+
+ if ($y2 >= 5) {
+ $precision?$y1++:$x++;
+ }
+
+ return "$x$y1";
+
+} # sub round_val
+
+sub obj_style {
+
+ my $style = {'stroke-miterlimit'=>(4*rand()),
+ 'stroke-linejoin'=>'miter',
+ 'stroke-linecap'=>'round',
+ 'stroke-width'=>(0.1+0.5*rand()),
+ 'stroke-opacity'=>(0.5+0.5*rand()),
+ 'stroke'=>'rgb('.255*round_up(rand()).','.255*round_up(rand()).','.255*round_up(rand()).')',
+ 'fill-opacity'=>(0.5+0.5*rand()),
+ 'fill'=>'rgb('.255*round_up(rand()).','.255*round_up(rand()).','.255*round_up(rand()).')',
+ 'opacity'=>(0.5+0.5*rand()) };
+
+ return $style;
+
+}
+
+sub text_style {
+
+ my $style = {'font-family'=>'Arial',
+ 'font-size'=>8+5*rand(),
+ 'stroke-width'=>1+2*rand(),
+ 'stroke-opacity'=>(0.2+0.5*rand()),
+ 'stroke'=>'rgb('.255*round_up(rand()).','.255*round_up(rand()).','.255*round_up(rand()).')',
+ 'fill-opacity'=>1,
+ 'fill'=>'rgb('.255*round_up(rand()).','.255*round_up(rand()).','.255*round_up(rand()).')',
+ 'opacity'=>(0.5+0.5*rand()) };
+
+ return $style;
+
+}
+
+#---------
22 examples/minsvg.pl
@@ -0,0 +1,22 @@
+#!/usr/bin/perl -w
+
+use strict;
+
+
+BEGIN {
+ push @INC , '../';
+ push @INC , '../SVG';
+}
+
+use SVG;
+
+# create an SVG object
+my $svg= SVG->new(width=>100,height=>100);
+$svg->pi('we are surround you','surrender all your bases');
+$svg->comment('I am a comment','and another comment');
+$svg->circle(cx=>100, cy=>100, r=>50, id=>'circle_in_group_y');
+# now render the SVG object, implicitly use svg namespace
+
+print "Content-type: image/svg+xml\n\n";
+
+print $svg->xmlify(-dtd=>'http://this-is-my-dtd.html.hereIam');
25 examples/starpath.cgi
@@ -0,0 +1,25 @@
+#!/usr/bin/perl -w
+
+BEGIN {
+ push @INC , '../';
+ push @INC , '../SVG';
+}
+
+use strict;
+use SVG;
+
+
+my $svg = SVG->new();
+
+my $def = $svg->defs( id => 'myStar' );
+
+my $r_star_path = $svg->get_path(type=>'path',x=>[-0.951,0.951,-0.588,0.000,0.588],y=>[-0.309,-0.309,-0.809,-1.000,0.809],-closed=>1);
+
+my $star = $def->path('transform' => "scale(100, 100)",%$r_star_path,);
+
+$svg->use(-href => "#myStar", stroke=>"red",fill => "yellow", transform => "translate(200, 200)" );
+
+print "Content-Type: image/svg+xml\n\n";
+
+print $svg->xmlify;
+
387 examples/sun_text_sample.pl
@@ -0,0 +1,387 @@
+#!/usr/bin/perl
+
+BEGIN {
+ push @INC , '../';
+ push @INC , '../SVG';
+}
+
+use SVG;
+use strict;
+use CGI ':header';
+
+my $p = CGI->new;
+print $p->header(-type=>'image/svg+xml');
+
+my $svg = SVG->new(width=>500,height=>500);
+$svg->desc()->cdata('This example shows some more features of SVG Text');
+$svg->title()->cdata('Sample 3: text');
+
+$svg->comment(
+'hello I am a dog. Actually, I am an SVG demo of the perl SVG.pm module',
+'While the original static example was done by SUN, this is a 100% dynamic',
+'sample. Case in point. Last time I looked, the SUN sample did not work on any',
+'of my browser implementations.',
+'=========================================================================',
+'SVG Sample Pool : Text',
+'This sample shows some powerful features of SVG Text elements ',
+'among which are the "text" element; "tspan" element; "textPath" element;',
+'text orientation management using "writing-mode" and text alignment',
+'using property of "text-anchor". Some font-related features are also',
+'Sun @author Sheng Pei, Vincent Hardy ',
+'Copyright Sun Microsystems Inc., 2000-2002 ',
+'Notice that the copyright is next year!! Today is 13.10.01 (editor)',
+'I wondef if the copyright includes machine-generated renditions of',
+'the content, like I am doing. Awfully presumptuous to copyright',
+'content that is being offered as a sample of SVG application',
+'=========================================================================',
+);
+
+my $defg_m = $svg->defs()->group(id=>'marker',style=>{"stroke-width"=>1});
+$defg_m->line(x1=>-15,y1=>0,x2=>15,y2=>0,style=>{'stroke'=>'currentColor'});
+$defg_m->line(y1=>-15,x1=>0,y2=>15,x2=>0,style=>{'stroke'=>'currentColor'});
+
+$svg->comment(
+'=====================================================================',
+'Simple text element, for the graphics title. ',
+'This illustrates a very simple text element where text is centered ',
+'about its anchor. ',
+'=====================================================================',
+'Draw simple text');
+$svg->text(x=>200, y=>80, style=>
+ {'text-anchor'=>'middle', 'font-size'=>60, 'font-weight'=>800, 'font-family'=>'Verdana', 'font-style'=>'italic'})->cdata('hello, Sun.');
+
+$svg->comment('Display marker for the anchor point');
+$svg->use(-href=>"#marker", style=>"color:black", transform=>'translate(200, 80)');
+
+$svg->comment(
+'=====================================================================',
+"The first part of the picture: 'SVG' following the upper curved line",
+'defs / xlink:href in textPath is the way to achieve text on a path.',
+'This illustrates: text, textPath and tspan',
+'=====================================================================',
+'Define the path on which text is laid out');
+my $path = $svg->get_path(x=>[-100,0, 200,200],y=>[0,-100,-100,0]);
+$svg->defs()->path(id=>"Path1",%$path);
+
+
+
+my $textLayout1 = $svg->group(id=>"textLayout1", transform=>"translate(200, 250)");
+
+ $textLayout1->comment('Draw the path on which text is laid out');
+ $textLayout1->use(-href=>"#Path1", style=>{stroke=>'yellow','stroke-width'=>40, 'fill'=>'none'});
+ $textLayout1->use(-href=>"#Path1", style=>{stroke=>'black','stroke-width'=>1, fill=>'none'});
+
+ $textLayout1->comment('Layout text on path');
+ $textLayout1->text(style=>{'font-family'=>'Verdana',
+ 'font-size'=>80, 'font-weight'=>800,
+ fill=>'blue', 'text-anchor'=>'middle'});
+
+ my $textLayoutpath1 = $textLayout1->text(-type=>'path', -href=>"#Path1", startOffset=>"0");
+ $textLayoutpath1->text(-type=>'span', style=>"fill:black")->cdata('S');
+ $textLayoutpath1->text(-type=>'span', style=>{stroke=>'black',fill=>'white'})->cdata('V');
+ $textLayoutpath1->text(-type=>'span', style=>"fill:red")->cdata('G');
+
+$svg->comment('textLayout1',
+'=======================================================================',
+"The second part of the picture: 'is' following the right vertical line ",
+'This illustrates glyph layout capabilities, here top to bottom layout.',
+'======================================================================='
+);
+
+ $svg->defs()->path(id=>"Path2", d=>"M 100 0 l 0 150");
+
+
+
+
+ my $tl2 = $svg->group(id=>"textLayout2" ,transform=>"translate(200, 250)");
+
+ $tl2->use(-href=>"#Path2", style=>{stroke=>'red', 'stroke-width'=>40});
+
+
+ $tl2->comment("Here we change the writing-mode of the text element to 'tb' (for 'top to bottom')");
+
+ $tl2->text( x=>"100", y=>"75", style=>{'font-family'=>'Verdana', 'font-weight'=>800, 'font-size'=>50,fill=>'white', 'writing-mode'=>'tb', 'text-anchor'=>'middle'})->cdata('is');
+
+ $tl2->use( -href=>"#marker", style=>"color:black;", transform=>"translate(100, 75)" );
+
+
+
+$svg->comment('======================================================================',
+"Third part of the picture: 'very' following the bottom horizontal line",
+'This illustrates one way of displaying text upside down. ',
+'======================================================================',
+'Define the path where the text is laid out');
+
+ $svg->defs()->path(id=>"Path3", d=>"M 100 150 l -200 0");
+
+
+$svg->comment('Draw the path on which text is laid out');
+my $tl3 = $svg->group( id=>"textLayout3", transform=>"translate(200, 250)");
+$tl3->use(-href=>"#Path3", style=>"stroke:yellow; stroke-width:40");
+$tl3->use( -href=>"#Path3", style=>{stroke=>'black','stroke-width'=>1});
+$tl3->text(style=>{ 'font-family'=>'Verdana', 'font-size'=>40,
+ 'font-weight'=>900, fill=>'black',
+ stroke=>'none', 'text-anchor'=>'middle'} );
+$tl3->text(type=>'path', -href=>"#Path3", 'xml:space'=>"default")->cdata('very');
+
+$svg->comment('textLayout3');
+
+
+
+
+
+$svg->comment('========================================================================',
+"The fourth part of the picture: 'cool' following the left vertical line",
+'This further illustrates tspan, this time directly in a text element.',
+'========================================================================');
+
+$svg->defs()->path(id=>"Path4", d=>"M -100 150 l 0 -150" );
+
+
+my $tl4 = $svg->group(id=>"textLayout4", transform=>"translate(200, 250)");
+
+ $tl4->use( -href=>"#Path4", style=>"stroke:red; stroke-width:40");
+
+ my $tl4_t = $tl4->text( x=>"0", y=>"0",
+ style=>{'font-family'=>'Verdana', 'font-size'=>50,
+ 'font-style'=>'italic',fill=>'white',
+ stroke=>'black', 'writing-mode'=>'lr',
+ 'text-anchor'=>"middle"},
+ transform=>"translate(-100, 75) rotate(-90)");
+$tl4_t->tspan(dy=>"0")->cdata('cool!');
+$tl4_t->tspan(dy=>"-25",
+ style=>{'font-size'=>10, stroke=>'none', fill=>'black'})
+ ->cdata('SVG');
+$tl4_t->tspan(dy=>"0",style=>{'font-size'=>10, stroke=>'none', fill=>'black'})->cdata('SVG');
+
+$tl4->use(transform=>"translate(-100, 75)", -href=>"#marker", style=>"color:black;");
+
+$svg->comment(
+'=============================================================================',
+"Below are steps to produce the 'SVG' in the box, mainly using the text-anchor",
+'to align the three glyphs ',
+'This illustrates the various text anchors. ',
+'=============================================================================');
+
+ my $tl5 = $svg->group( id=>"textLayout5", transform=>"translate(180, 290)", style=>"font-weight:800");
+
+ $tl5->use( -href=>"#marker", style=>{fill=>'black', stroke=>'black',transform=>'translate(30, 50)'});
+
+ $tl5->comment('Anchored to the end');
+ $tl5->text( x=>"30", y=>"50", style=>{'font-family'=>'Verdana','font-size'=>100,
+ stroke=>'black', fill=>'none', 'text-anchor'=>'end'})->cdata('S');
+
+
+ $tl5->comment('Anchored to the start');
+ $tl5->text( x=>"30", y=>"50",
+ style=>{'font-family'=>'Verdana', 'font-size'=>40,
+ 'font-weight'=>700, stroke=>'black',fill=>'none',
+ 'text-anchor'=>'start'})
+ ->cdata('G');
+
+
+ $tl5->comment("When the orientation is 'top_bottom' using 'start' as the anchor makes",
+ 'the glyph aligns to the upper line',);
+
+ $tl5->use(-href=>"#marker", style=>"color:red", transform=>"translate(48, -30)");
+
+ $tl5->comment('Anchored to the start, with top to bottom text layout');
+ $tl5->text( x=>"48", y=>"-30",
+ style=>{'font-family'=>'Verdana',
+ 'font-size'=>50,stroke=>'red',
+ fill=>'none','writing-mode'=>'tb',
+ 'text-anchor'=>'start'})
+ ->cdata('V');
+
+
+$svg->anchor(-href=>"http://roitsystems.com/")->text(x=>200, y=>160, style=>
+ {'text-anchor'=>'middle', 'font-size'=>30, 'font-weight'=>800, 'font-family'=>'Verdana', 'font-style'=>'italic', opacity=>0.3})->cdata('Use SVG.pm');
+
+print $svg->xmlify;
+
+
+__END__
+
+
+
+<?xml version="1.0" encoding="iso-8859-1"?>
+
+
+<!-- ========================================================================= -->
+<!-- SVG Sample Pool : Text -->
+<!-- -->
+<!-- This sample shows some powerful features of SVG Text elements -->
+<!-- among which are the "text" element; "tspan" element; "textPath" element; -->
+<!-- text orientation management using "writing-mode" and text alignment -->
+<!-- using property of "text-anchor". Some font-related features are also -->
+<!-- exercised. -->
+<!-- -->
+<!-- @author Sheng Pei, Vincent Hardy -->
+<!-- XML Technology Center, Sun Microsystems Inc. -->
+<!-- @version 1.1, July 5 2000 -->
+<!-- @version 1.0, June 27 2000 -->
+<!-- -->
+<!-- Copyright Sun Microsystems Inc., 2000-2002 -->
+<!-- ========================================================================= -->
+
+
+<svg width="500" height="500" xml:space="default">
+
+ <desc> This example shows some more features of SVG Text. </desc>
+ <title> Sample 3: text </title>
+ <defs>
+ <g id="marker" style="stroke-width:1">
+ <line x1="-15" y1="0" x2="15" y2="0" style="stroke:currentColor" />
+ <line y1="-15" x1="0" y2="15" x2="0" style="stroke:currentColor" />
+ <circle cx="0" cy="0" r="3" style="fill:currentColor" />
+ </g>
+ </defs>
+
+<!-- ===================================================================== -->
+<!-- Simple text element, for the graphics title. -->
+<!-- This illustrates a very simple text element where text is centered -->
+<!-- about its anchor. -->
+<!-- ===================================================================== -->
+
+<!-- Draw simple text -->
+<text x="200" y="80" style="text-anchor:middle; font-size:60; font-weight:800; font-family:Verdana; font-style:italic">SVG Text</text>
+
+<!-- Display marker for the anchor point -->
+<use xlink:href="#marker" style="color:black" transform="translate(200, 80)"/>
+
+<!-- ===================================================================== -->
+<!-- The first part of the picture: 'SVG' following the upper curved line -->
+<!-- defs / xlink:href in textPath is the way to achieve text on a path. -->
+<!-- This illustrates: text, textPath and tspan -->
+<!-- ===================================================================== -->
+
+ <!-- Define the path on which text is laid out -->
+ <defs>
+ <path id="Path1"
+ d="M -100 0 c 0 -100 200 -100 200 0" />
+ </defs>
+
+ <g id="textLayout1" transform="translate(200, 250)">
+
+ <!-- Draw the path on which text is laid out -->
+ <use xlink:href="#Path1" style="stroke:yellow; stroke-width:40; fill:none;" />
+ <use xlink:href="#Path1" style="stroke:black; stroke-width:1; fill:none;" />
+
+ <!-- Layout text on path -->
+ <text style="font-family:Verdana; font-size:80; font-weight:800; fill:blue; text-anchor:middle">
+ <textPath xlink:href="#Path1" startOffset="0" >
+<tspan style="fill:black">S</tspan>
+<tspan style="stroke:black; fill:white;">V</tspan>
+<tspan style="fill:red">G</tspan>
+ </textPath>
+ </text>
+
+ </g> <!-- textLayout1 -->
+
+<!-- ======================================================================= -->
+<!-- The second part of the picture: 'is' following the right vertical line -->
+<!-- This illustrates glyph layout capabilities, here top to bottom layout. -->
+<!-- ======================================================================= -->
+
+ <defs>
+ <path id="Path2"
+ d="M 100 0 l 0 150" />
+ </defs>
+
+ <g id="textLayout2" transform="translate(200, 250)" >
+
+ <use xlink:href="#Path2" style="stroke:red; stroke-width:40" />
+
+
+ <!-- Here we change the writing-mode of the text element to 'tb' (for 'top to bottom') -->
+ <text x="100" y="75" style="font-family:Verdana; font-weight:800; font-size:50;
+ fill:white; writing-mode:tb; text-anchor:middle">is</text>
+
+ <use xlink:href="#marker" style="color:black;" transform="translate(100, 75)" />
+ </g>
+
+
+<!-- ====================================================================== -->
+<!-- Third part of the picture: 'very' following the bottom horizontal line -->
+<!-- This illustrates one way of displaying text upside down. -->
+<!-- ====================================================================== -->
+
+ <!-- Define the path where the text is laid out -->
+ <defs>
+ <path id="Path3"
+ d="M 100 150 l -200 0" />
+ </defs>
+
+ <!-- Draw the path on which text is laid out -->
+
+ <g id="textLayout3" transform="translate(200, 250)">
+ <use xlink:href="#Path3" style="stroke:yellow; stroke-width:40" />
+ <use xlink:href="#Path3" style="stroke:black; stroke-width:1" />
+
+ <text style="font-family:Verdana; font-size:40; font-weight:900; fill:black; stroke:none; text-anchor:middle">
+ <textPath xlink:href="#Path3" xml:space="default">very</textPath>
+ </text>
+
+ </g> <!-- textLayout3 -->
+
+<!-- ======================================================================== -->
+<!-- The fourth part of the picture: 'cool' following the left vertical line -->
+<!-- This further illustrates tspan, this time directly in a text element. -->
+<!-- ======================================================================== -->
+
+ <defs>
+ <path id="Path4"
+ d="M -100 150 l 0 -150" />
+ </defs>
+
+ <g id="textLayout4" transform="translate(200, 250)">
+ <use xlink:href="#Path4" style="stroke:red; stroke-width:40" />
+
+ <text x="0" y="0" style="font-family:Verdana; font-size:50;
+ font-style:italic; fill:white; stroke:black; writing-mode:lr; text-anchor:middle;"
+ transform="translate(-100, 75) rotate(-90)">
+<tspan dy="0">
+cool!
+</tspan>
+<tspan dy="-25" style="font-size:10; stroke:none; fill:black;">
+SVG
+</tspan>
+ </text>
+
+ <use transform="translate(-100, 75)" xlink:href="#marker" style="color:black;" />
+ </g>
+
+<!-- ============================================================================= -->
+<!-- Below are steps to produce the 'SVG' in the box, mainly using the text-anchor -->
+<!-- to align the three glyphs -->
+<!-- This illustrates the various text anchors. -->
+<!-- ============================================================================= -->
+
+ <g id="textLayout5" transform="translate(180, 290)" style="font-weight:800">
+
+ <use xlink:href="#marker" style="fill:black; stroke:black" transform="translate(30, 50)" />
+
+ <!-- Anchored to the end -->
+ <text x="30" y="50" style="font-family:Verdana; font-size:100;
+ stroke:black; fill:none; text-anchor:end">S</text>
+
+
+ <!-- Anchored to the start -->
+ <text x="30" y="50" style="font-family:Verdana; font-size:40;
+ font-weight:700; stroke:black; fill:none; text-anchor:start">G</text>
+
+
+<!-- When the orientation is 'top_bottom' using 'start' as the anchor makes -->
+<!-- the glyph aligns to the upper line -->
+
+ <use xlink:href="#marker" style="color:red" transform="translate(48, -30)" />
+
+ <!-- Anchored to the start, with top to bottom text layout -->
+ <text x="48" y="-30" style="font-family:Verdana; font-size:50;
+ stroke:red; fill:none; writing-mode:tb; text-anchor:start">
+ V
+ </text>
+
+ </g>
+
+</svg>
27 examples/svg.pl
@@ -0,0 +1,27 @@
+#!/usr/bin/perl -w
+
+use strict;
+
+BEGIN {
+ push @INC , '../';
+ push @INC , '../SVG';
+}
+
+use SVG;
+
+# create an SVG object
+my $svg= SVG->new(width=>200,height=>200);
+$svg->title()->cdata('I am a title');
+# use explicit element constructor to generate a group element
+my $y=$svg->group(
+ id => 'group_y',
+ style => { stroke=>'red', fill=>'green' }
+);
+$y->circle(cx=>100, cy=>100, r=>50, id=>'circle_in_group_y');
+# add a circle to the group
+$y->circle(cx=>100, cy=>100, r=>50, id=>'circle_in_group_y');
+$y->comment('This is a comment');
+$y->circle(cx=>100, cy=>100, r=>50, id=>'circle_in_group_y');
+
+# now render the SVG object, implicitly use svg namespace
+print $svg->xmlify;
147 examples/svg_dom_sample.pl
@@ -0,0 +1,147 @@
+#!/usr/bin/perl -w
+use strict;
+use SVG(-indent=>" ");
+
+# subroutine to print out attributes
+#
+sub show_attributes ($) {
+ my $node = shift;
+ my $ref = $node->getAttributes();
+ my @attrs = keys %$ref;
+ print "This node has ".(scalar @attrs)." attributes:\n";
+ foreach my $i (@attrs) {
+ print " $i=\"$ref->{$i}\"\n";
+ }
+}
+
+my $s = SVG->new(width=>100,height=>50);
+my $g1 = $s->group(id=>'group_1');
+$g1->circle(width=>1,height=>1,id=>'test_id');
+$g1->rect(id=>'id_2');
+$g1->rect(id=>'id_3');
+$g1->rect(id=>'id_4',x=>15,y=>150);
+$g1->anchor(-xref=>'http://www.roitsystems.com/tutorial/',id=>'anchor_1')
+ ->text(id=>'text_1',x=>15,y=>150,stroke=>'red')->cdata('Hello, World');
+
+my $g2 = $s->group(id=>'group_2');
+$g2->ellipse(id=>'id_5');
+$g2->ellipse(id=>'id_6');
+$g2->ellipse(id=>'id_7');
+
+$s->ellipse(id=>'id_8');
+$s->ellipse(id=>'id_9');
+
+print "SVG::DOM Demonstration\n";
+print "\n","="x40,"\n\n";
+print "The example document looks like this:\n\n";
+print $s->xmlify();
+print "\n\n","="x40,"\n\n";
+
+#
+# Test of getElementName
+#
+print "The document element is of type \"".$s->getElementName()."\"\n";
+
+#
+# Test of getAttributes
+#
+show_attributes($s);
+
+print "\n","-"x40,"\n\n";
+print "Document contents by element type:\n";
+#
+# Test of getElements
+#
+my @e_names = qw/rect ellipse a g svg/;
+
+foreach my $e_name (@e_names) {
+
+ print " There are ".scalar @{$s->getElements($e_name)}." '$e_name' elements\n";
+
+ foreach my $e (@{$s->getElements($e_name)}) {
+ if (my $e_id = $e->getElementID) {
+ print " $e has id \"$e_id\"\n";
+ die "The id should always map back to the element"
+ unless $s->getElementByID($e_id)==$e;
+ } else {
+ print " $e has no id\n";
+ }
+ }
+
+}
+
+print "\n","-"x40,"\n\n";
+
+my @kids = $s->getChildren();
+print "The document element has ",scalar (@kids)," children (should be 1)\n";
+
+foreach my $kid (@kids) {
+ print "Found a <",$kid->getElementName(),"> child element:\n";
+ show_attributes($kid);
+}
+
+# Test of getElementByID
+#
+my $group=$s->getElementByID("group_1");
+print "Group 1 relocated by id group_1\n" if $group==$g1;
+
+print "\n","="x40,"\n";
+
+# Test of getChildren
+#
+my $children = $group->getChildren();
+foreach my $v (0..$#{$children}) {
+ # Test of getElementName on this child
+ #
+ my $name = $children->[$v]->getElementName;
+ print "\nChild element $v is is a <$name> element.\n";
+
+ print "It looks like this:\n\n";
+ print $children->[$v]->xmlify();
+ print "\n";
+
+ # Test of getParent
+ #
+ my $parent = $children->[$v]->getParent;
+ my $parent_name = $parent->getElementName;
+ print "Its parent is a <$parent_name> element\n";
+
+ # Test of getChildIndex
+ #
+ print "It is index number ",$children->[$v]->getChildIndex()," in the parent.\n";
+
+ # Test of getAttributes
+ #
+ my $ref = $children->[$v]->getAttributes();
+ my @attrs = keys %$ref;
+ print "It has ".(scalar @attrs)." attribute".($#attrs?"s":"").":\n";
+ foreach my $attr (@attrs) {
+ print " $attr=\"$ref->{$attr}\"\n";
+ }
+
+ # Test of getPreviousSibling
+ #
+ if (my $prev = $children->[$v]->getPreviousSibling) {
+ print "The element before it is a <".$prev->getElementName.">\n";
+ } else {
+ print "It is the first child element\n";
+ }
+
+ # Test of getNextSibling
+ #
+ if (my $next = $children->[$v]->getNextSibling) {
+ print "The element after it is a <".$next->getElementName.">\n";
+ } else {
+ print "It is the last child element\n";
+ }
+
+ print "\n","-"x40,"\n";
+}
+
+# Test of getCDATA
+#
+my $text_element=$s->getElementByID("text_1");
+print "\nAnd finally, element 'text_1' says ",$text_element->getCDATA(),"!\n";
+
+print "\n","="x40,"\n";
+
237 examples/svgtest2.pl
@@ -0,0 +1,237 @@
+#!/usr/bin/perl -w
+
+use strict;
+use CGI;
+
+BEGIN {
+ push @INC , '../';
+ push @INC , '../SVG';
+}
+
+use SVG;
+
+my $VERSION = 3;
+
+#---------Create the CGI object which is required to handle the header
+my $p = CGI->new();
+
+$| = 1;
+
+
+#---------print the header just before outputting to screen
+
+
+
+
+#---------
+
+#---------Create the svg object
+
+my $height = $p->param('h') || 400;
+my $width = $p->param('w') || 800;
+
+my $svg= SVG->new(width=>$width,height=>$height);
+
+my $y=$svg->group( id=>'group_generated_group',style=>{ stroke=>'red', fill=>'green' });
+
+my $z=$svg->tag('g', id=>'tag_generated_group',style=>{ stroke=>'red', fill=>'black' });
+
+
+my $ya = $y -> anchor(
+ -href => 'http://somewhere.org/some/line.html',
+ -target => 'new_window_0');
+
+
+my $line_transform = 'matrix(0.774447 0.760459 0 0.924674 357.792 -428.792)';
+
+my $line = $svg->line(id=>'l1',x1=>(rand()*$width+5),
+ y1=>(rand()*$height+5),
+ x2=>(rand()*$width-5),
+ y2=>(rand()*$height-5),
+ style=>&obj_style,);
+
+#---------
+foreach (1..&round_up(rand(20))) {
+ my $myX = $width-rand(2*$width);
+ my $myY = $height-rand(2*$height);
+
+ my $rect = $y->rectangle (x=>$width/2,
+ y=>$height/2,
+ width=>(50+50*rand()),
+ height=>(50+50*rand()),
+ rx=>20*rand(),
+ ry=>20*rand(),
+ id=>'rect_1',
+ style=>&obj_style);
+
+ $rect->animate(attributeName=>'transform',
+ attributeType=>'XML',
+ from=>'0 0',
+ to=>$myX.' '.$myY,
+ dur=>&round_up(rand(20),2).'s',
+ repeatCount=>&round_up(rand(30)),
+ restart=>'always',
+ #-method=>'transform',
+ );
+}
+my $a = $z -> anchor(
+ -href => 'http://somewhere.org/some/other/page.html',
+ -target => 'new_window_0',
+ id=>'anchor a');
+
+my $a1 = $z -> anchor(
+ -href => '/index.html',
+ -target => 'new_window_1',
+ id=>'anchor a1');
+
+my $a2 = $z -> anchor(
+ -href => '/svg/index.html',
+ -target => 'new_window_2',
+ id=>'anchor a2');
+
+#---------
+
+my $c;
+foreach (1..&round_up(rand(5))) {
+
+ $c= $a->circle(cx=>($width-20)*rand(),
+ cy=>($height-20)*rand(),
+ r=>100*rand(),
+ id=>'c1',
+ style=>&obj_style);
+
+ $c = $a1->circle(cx=>($width-20)*rand(),
+ cy=>($height-20)*rand(),
+ r=>100*rand(),
+ id=>'c2',
+ style=>&obj_style);
+}
+#---------
+
+my $xv = [$width*rand(), $width*rand(), $width*rand(), $width*rand()];
+
+my $yv = [$height*rand(), $height*rand(), $height*rand() ,$height*rand()];
+
+my $points = $a->get_path(x=>$xv,
+ y=>$yv,
+ -type=>'polyline',
+ -closed=>'true',);
+
+
+$c = $a1->polyline (%$points,
+ id=>'pline1',
+ style=>&obj_style);
+
+#---------
+
+$xv = [$width*rand(), $width*rand(), $width*rand(), $width*rand()];
+
+$yv = [$height*rand(), $height*rand(), $height*rand() ,$height*rand()];
+
+$points = $a->get_path(x=>$xv,
+ y=>$yv,
+ -type=>'polygon',);
+
+
+$c = $a->polygon (%$points,
+ id=>'pgon1',
+ style=>&obj_style);
+#---------
+
+
+my $t=$a2->text(id=>'t1',
+ transform=>'rotate(-45)',
+ style=>&text_style);
+#---------
+
+
+my $u=$a2->text(id=>'t3',
+ x=>$width/2*rand(),
+ y=>($height-80)*rand(),
+ transform=>'rotate('.(-2.5*5*rand()).')',
+ style=>&text_style);
+
+
+
+my $v=$a2->tag('text',
+ id=>'t5',
+ x=>$width/2*rand(),
+ y=>$height-40+5*rand(),
+ transform=>'rotate('.(-2.5*5*rand()).')',
+ style=>&text_style);
+
+my $w=$a2->text(id=>'t5',
+ x=>$width/2*rand(),
+ y=>$height-20+5*rand(),
+ transform=>'rotate('.(-2.5*5*rand()).')',
+ style=>&text_style);
+
+
+$t->cdata('Text generated using the high-level "text" tag');
+$t->cdata('Courtesy of RO IT Systems GmbH');
+$v->cdata('Text generated using the low-level "tag" tag');
+$w->cdata('But what about inline SVG? Yes, we do that too');
+$w->cdata('All this with SVG.pm? Wow.');
+
+print $p->header('image/svg-xml');
+print $svg->render
+;
+
+exit;
+
+
+#################
+# Subroutine to round up the value of a number or of a text representation of number
+#
+sub round_up {
+ my ($x, $precision) = shift;
+ $x =~ s/^\s+//g;
+ $x =~ s/\s+$//g;
+ $x =~ s/,//g;
+
+ my $y;
+ $precision = 0 unless $precision;
+ ($x, $y) = split( /\./, $x) if $x =~ /\./;
+ my $y1 = substr($y, 0, $precision);
+ my $y2 = substr($y, $precision, 1);
+
+ if ($y2 >= 5) {
+ $precision?$y1++:$x++;
+ }
+
+ return "$x$y1";
+
+} # sub round_val
+
+sub obj_style {
+
+ my $style = {'stroke-miterlimit'=>(4*rand()),
+ 'stroke-linejoin'=>'miter',
+ 'stroke-linecap'=>'round',
+ 'stroke-width'=>(0.1+0.5*rand()),
+ 'stroke-opacity'=>(0.5+0.5*rand()),
+ 'stroke'=>'rgb('.255*round_up(rand()).','.255*round_up(rand()).','.255*round_up(rand()).')',
+ 'fill-opacity'=>(0.5+0.5*rand()),
+ 'fill'=>'rgb('.255*round_up(rand()).','.255*round_up(rand()).','.255*round_up(rand()).')',
+ 'opacity'=>(0.5+0.5*rand()) };
+
+ return $style;
+
+}
+
+sub text_style {
+
+ my $style = {'font-family'=>'Arial',
+ 'font-size'=>8+5*rand(),
+ 'stroke-width'=>1+2*rand(),
+ 'stroke-opacity'=>(0.2+0.5*rand()),
+ 'stroke'=>'rgb('.255*round_up(rand()).','.255*round_up(rand()).','.255*round_up(rand()).')',
+ 'fill-opacity'=>1,
+ 'fill'=>'rgb('.255*round_up(rand()).','.255*round_up(rand()).','.255*round_up(rand()).')',
+ 'opacity'=>(0.5+0.5*rand()) };
+
+ return $style;
+
+}
+
+#---------
417 examples/yaph5.cgi
@@ -0,0 +1,417 @@
+#!/usr/bin/perl -w
+
+BEGIN {
+ push @INC , '../';
+ push @INC , '../SVG';
+}
+
+use strict;
+use CGI;
+use SVG;
+
+my $VERSION = 3;
+
+$| = 1;
+my $p = new CGI ':header';
+# open the header and start sending
+print $p->header(-type=>'image/svg-xml');
+
+
+my $points;
+my $path;
+my $style;
+my $transform;
+
+my $string;
+my $gradient;
+
+my $svg = SVG->new(width=>800,height=>600);
+
+my $lg = $svg->gradient(-type=>'linear',
+ 'id'=>"transparent-sky_1",
+ 'x1'=>"0%",
+ 'y1'=>"0%",
+ 'x2'=>"100%",
+ 'y2'=>"0%",
+ 'spreadMethod'=>"pad",
+ 'gradientUnits'=>"userSpaceOnUse");
+
+ $lg->stop(offset=>"0%",
+ style=>{'stop-color'=>'rgb(1,71,1)','stop-opacity'=>1});
+ $lg->stop(offset=>"37%",
+ style=>{'stop-color'=>'rgb(0,128,0)','stop-opacity'=>1});
+ $lg->stop(offset=>"38%",
+ style=>{'stop-color'=>'rgb(255,255,255)','stop-opacity'=>1});
+ $lg->stop(offset=>"45%",
+ style=>{'stop-color'=>'rgb(192,192,255)','stop-opacity'=>1});
+
+
+$svg->gradient(-type=>'linear',
+ id => "custom-paint_1",
+ x1=>"0%",
+ y1=>"0%",
+ x2=>"100%",
+ y2=>"0%",
+ spreadMethod=>"pad",
+ gradientUnits=>"objectBoundingBox");
+
+
+ $lg = $svg->gradient(-type=>'linear',
+ id =>'red-dark-green',
+ x1=>'0%',
+ y1=>'0%',
+ x2=>'100%',
+ y2=>'0%',
+ spreadMethod=>'pad',
+ gradientUnits=>'userSpaceOnUse');
+
+ $lg->stop(offset=>'0%',
+ style=>{'stop-color'=>'rgb(225,0,25)','stop-opacity'=>'0.75'});
+
+ $lg->stop(offset=>"100%", style=>{'stop-color'=>'rgb(0,96,27)','stop-opacity'=>0.5});
+
+my $lg2 = $svg->gradient(-type=>'linear',
+ id => 'black-white_1',
+ x1=>"0%",
+ y1=>"0%",
+ x2=>"100%",
+ y2=>"0%",
+ spreadMethod=>"pad",
+ gradientUnits=>"userSpaceOnUse");
+
+ $lg2->stop(offset=>"0%",
+ style=>{'stop-color'=>'rgb(0,0,0)','stop-opacity'=>"0.8"});
+ $lg2->stop(offset=>"100%",
+ style=>{'stop-color'=>'rgb(255,255,255)','stop-opacity'=>"1"});
+
+#XXX Is this the right parent?
+my $Argyle_1 = $svg->pattern(id=>"Argyle_1",
+ width=>"50",
+ height=>"50",
+ patternUnits=>"userSpaceOnUse",
+ patternContentUnits=>"userSpaceOnUse");
+
+
+my $Argyle_1_lg = $Argyle_1->gradient(id=>"red-yellow-red",
+ x1=>"0%",
+ y1=>"0%",
+ x2=>"100%",
+ y2=>"0%",
+ spreadMethod=>"pad",
+ gradientUnits=>"objectBoundingBox" );
+
+ $Argyle_1_lg->stop(offset=>"10%",
+ style=>{'stop-color'=>'rgb(255,0,0)','stop-opacity'=>1});
+
+ $Argyle_1_lg->stop(offset=>"50%",
+ style=>{'stop-color'=>'rgb(253,215,0)','stop-opacity'=>1});
+ $Argyle_1_lg->stop(offset=>"90%",
+ style=>{'stop-color'=>'rgb(255,0,0)','stop-opacity'=>1});
+
+ my $argyle_1_1 = $Argyle_1->gradient(-type=>'linear',
+ id=>"black-white",
+ x1=>"0%",
+ y1=>"0%",
+ x2=>"100%",
+ y2=>"0%",
+ spreadMethod=>"pad",
+ gradientUnits=>"objectBoundingBox");
+
+ $argyle_1_1->stop(offset=>"0%",
+ style=>{'stop-color'=>'rgb(255,0,0)','stop-opacity'=>'1'});
+
+ $argyle_1_1->stop(offset=>"100%",
+ style=>{'stop-color'=>'rgb(255,255,0)','stop-opacity'=>'1'});
+
+ my $Bumpy = $svg->filter(id=>'Bumpy',filterUnits=>"objectBoundingBox",
+ x=>"-10%",y=>"-10%",
+ width=>"150%", height=>"150%",
+ filterUnits=>'objectBoundingBox',);
+
+ $Bumpy->fe(-type=>'turbulence', baseFrequency=>'0.15',
+ numOctaves=>'1', result=>'image0');
+
+ $Bumpy->fe(-type=>"gaussianblur", stdDeviation=>"3",
+ in=>"image0", result=>"image1");
+
+ $Bumpy->fe(-type=>"diffuselighting",'in'=>"image1",
+ 'surfaceScale'=>10,'diffuseConstant'=>"1",'result'=>"image3",
+ style=>{'lighting-color'=>'rgb(255,255,255)'})
+ ->fe(-type=>'distantlight',azimuth=>"0", elevation=>"45");
+
+ $Bumpy->fe(-type=>"composite",in=>"image3",
+ in2=>"SourceGraphic",operator=>"arithmetic",
+ k2=>"0.5",k3=>"0.5",result=>"image4");
+
+ $Bumpy->fe(-type=>"composite",in=>"image4",
+ in2=>"SourceGraphic", operator=>"in",
+ result=>"image5");
+
+my $pointillist = $svg->filter(id=>"pointillist", filterUnits=>"objectBoundingBox",
+ x=>"-10%", y=>"-10%", width=>"150%", height=>"150%");
+ $pointillist->fe(-type=>'turbulence', baseFrequency=>"0.1",
+ numOctaves=>"2", result=>'I1');
+ $pointillist->fe(-type=>'morphology', in=>"I1", radius=>"5",
+ operator=>"dilate", result=>"I2");
+ $pointillist->fe(-type=>'colormatrix', in=>"I2", type=>"matrix",
+ values=>"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 255",
+ result=>"I3");
+ $pointillist->fe(-type=>'composite', in=>"I3",
+ in2=>"SourceGraphic", operator=>"in");
+
+
+ my $arg_1_grad_1 = $Argyle_1->gradient(id=>'custom-paint',
+ spreadMethod=>'pad',
+ gradientUnits=>'objectBoundingBox',
+ x1=>'0%',
+ x2=>'100%',
+ y1=>'0%',
+ y2=>'100%',);
+
+ $arg_1_grad_1->stop(offset=>'0%' ,'stop-color'=>'rgb(128,0,0)',
+ 'stop-opacity'=>1);
+ $arg_1_grad_1->stop(offset=>'37%','stop-color'=>'rgb(222,0,0)',
+ 'stop-opacity'=>.8);
+ $arg_1_grad_1->stop(offset=>'43%','stop-color'=>'rgb(255,128,128)',
+ 'stop-opacity'=>1);
+ $arg_1_grad_1->stop(offset=>'45%','stop-color'=>'rgb(255,0,0)',
+ 'stop-opacity'=>1);
+ $arg_1_grad_1->stop( offset=>'54%','stop-color'=>'rgb(192,0,0)',
+ 'stop-opacity'=>0.7);
+ $arg_1_grad_1->stop(offset=>'100%','stop-color'=>'rgb(240,0,175)',
+ 'stop-opacity'=>1);
+
+ my $arg_1_g_1 = $Argyle_1->group(id=>'group_inside_pattern_1');
+# $svg->emptyTag('polygon',
+# style=>"stroke:rgb(112,97,66);stroke-width:1;stroke-opacity:1;stroke-miterlimit:30;fill:rgb(215,207,189);fill-opacity:1",
+# points=>"25,10 34,25 25,40 16,25");
+
+ $points = "25,10 34,25 25,40 16,25";
+
+ $style = { 'stroke' => 'rgb(112,97,66)',
+ 'stroke-width' => 1,
+ 'stroke-opacity' => 1,
+ 'stroke-miterlimit' => 30,
+ 'fill' => 'rgb(215,207,189)',
+ 'fill-opacity' => '1' };
+
+ my $r_pts = $arg_1_g_1->get_path(x=>[25,34,25,16],y=>[10,25,40,25],-type=>'polygon');
+ $arg_1_g_1->polygon(id=>'pg1',%$r_pts,style=>$style);
+
+ $r_pts = $arg_1_g_1->get_path(x=>[50,59,50,41],y=>[10,25,40,25],-type=>'polygon');
+ $arg_1_g_1->polygon(id=>'pg2',%$r_pts,style=>$style);
+
+ $r_pts = $arg_1_g_1->get_path(x=>[0,9,0,-9],y=>[10,25,40,25],-type=>'polygon');
+ $arg_1_g_1->polygon(id=>'pg3',%$r_pts,style=>$style);
+
+ $r_pts = $arg_1_g_1->get_path(x=>[11,21,11,1],y=>[0,25,50,25],-type=>'polygon');
+ $arg_1_g_1->polygon(id=>'pg4',%$r_pts,style=>$style);
+
+ $r_pts = $arg_1_g_1->get_path(x=>[25,34,25,16],y=>[10,25,40,25],-type=>'polygon');
+ $arg_1_g_1->polygon(id=>'pg5',%$r_pts,style=>$style);
+
+
+ $style = { 'stroke' => 'rgb(52,48,40)',
+ 'stroke-width' => 1,
+ 'stroke-opacity' => 1,
+ 'stroke-miterlimit' => 30,
+ 'fill' => 'rgb(172,152,112)',
+ 'fill-opacity' => '1' };
+
+ $r_pts = $arg_1_g_1->get_path(x=>[20,30,25],y=>[0,0,9],-type=>'polygon');
+ $arg_1_g_1->polygon(id=>'pg6',%$r_pts,style=>$style);
+
+ $r_pts = $arg_1_g_1->get_path(x=>[20,25,30],y=>[50,41,50],-type=>'polygon');
+ $arg_1_g_1->polygon(id=>'pg7',%$r_pts,style=>$style);
+
+
+ $svg->rect(x=>"193", y=>"201",
+ width=>"422", height=>"140",
+ rx=>"3",ry=>"6",
+ 'stroke-miterlimit'=>4,
+ 'stroke-linejoin'=>'miter',
+ 'stroke-width'=>1,
+ 'stroke-opacity'=>1,
+ 'stroke'=>'rgb(0,0,0)',
+ 'fill-opacity'=>1,
+ 'fill'=>'rgb(148,65,175)',
+ 'opacity'=>0.31);
+
+
+
+
+
+
+ $style = {'stroke-miterlimit'=>4,
+ 'stroke-linejoin'=>'miter',
+ 'stroke-linecap'=>'round',
+ 'stroke-width'=>'11',
+ 'stroke-opacity'=>1,
+ 'stroke'=>'rgb(0,0,0)',
+ 'fill-opacity'=>1,
+ 'fill'=>'rgb(0,0,0)',
+ 'opacity'=>'0.5'};
+
+
+$svg->text(x=>"318", y=>"333",
+ transform=>'matrix(1.58041 -0.293543 0.333969 1.3891 -396.141 -55.3847)', style=>{'font-family'=>'Arial Rounded MT Bold',
+ 'font-size'=>100,'stroke-width'=>1,'stroke-opacity'=>1,
+ stroke=>'rgb(0,0,0)', 'fill-opacity'=>1,fill=>'rgb(0,0,0)',
+ opacity=>1,visibility=>'inherit'},
+ filter=>'url(#pointillist)')
+ ->cdata('A');
+
+$svg->polygon(points=>'33.6776,266.425 34.408,266.795 33.6684,267.165 33.8903,266.795',
+ 'stroke-miterlimit'=>4, 'stroke-linejoin'=>'miter',
+ fill=>'rgb(0,0,0)');
+
+$svg->polygon(points=>'75.8931,140.313 -18,268.028 77.0816,395.744 48.5571,268.028',
+ 'stroke-linejoin'=>'miter',
+ fill=>'url(#red-yellow-red)',
+ filter=>'url(#Bumpy)');
+
+
+$style = {'stroke-miterlimit'=>'4',
+ 'stroke-linejoin'=>'miter',
+ 'stroke-linecap'=>'round',
+ 'stroke-width'=>'11',
+ 'stroke-opacity'=>'1',
+ 'stroke'=>'url(#Argyle_1)',
+ 'fill-opacity'=>'1',
+ 'fill'=>'rgb(12,5,1)',
+ 'opacity'=>'0.5'};
+
+$path = "M311.591 367.68 L354.854 124.686 L459.18 160.388 L455.469 199.691 L404.735 219.984 L360.521 215.961 L326.636 369.343";
+
+$svg->path(d=>$path,style=>$style);
+
+
+$transform = 'matrix(0.994363 0.10603 -0.10603 0.994363 32.2186 -53.9305)';
+
+$style = { 'stroke-width' =>1,
+ 'stroke-opacity'=>1,
+ 'stroke' =>'rgb(241,19,19)',
+ 'fill-opacity' =>1,
+ 'fill' =>'rgb(243,214,21)',
+ 'opacity' =>1 };
+
+my $shape_array = [ {cx=>"474.862" , cy=>"178.408" , rx=>"9.24547" , ry=>"9.61528"},
+ {cx=>"478.93" , cy=>"224.266" , rx=>"8.87565" , ry=>"8.13601"},
+ {cx=>"477.081" , cy=>"260.878" , rx=>"9.9851" , ry=>"10.7247"},
+ {cx=>"481.519" , cy=>"319.309" , rx=>"11.4644" , ry=>"11.4644"},
+ {cx=>"479.3" , cy=>"366.646" , rx=>"10.7247" , ry=>"10.7247"},
+ {cx=>"559.181" , cy=>"183.955" , rx=>"9.9851" , ry=>"9.9851"},
+ {cx=>"561.03" , cy=>"231.662" , rx=>"9.61528" , ry=>"9.61528"},
+ {cx=>"568.796" , cy=>"283.067" , rx=>"12.204" , ry=>"12.204"},
+ {cx=>"563.988" , cy=>"332.992" , rx=>"8.13601" , ry=>"8.13601"},
+ {cx=>"563.619" , cy=>"375.521" , rx=>"7.76619" , ry=>"7.76619"},
+ {cx=>"508.885" , cy=>"270.493" , rx=>"5.54728" , ry=>"5.54728"},
+ {cx=>"525.527" , cy=>"266.425" , rx=>"4.43782" , ry=>"4.43782"},
+ {cx=>"521.459" , cy=>"278.629" , rx=>"2.58873" , ry=>"2.58873"},
+ {cx=>"532.184" , cy=>"276.04" , rx=>"2.21891" , ry=>"2.21891"},
+ {cx=>"541.06" , cy=>"268.644" , rx=>"5.9171" , ry=>"5.9171"},
+ {cx=>"544.018" , cy=>"283.437" , rx=>"2.95855" , ry=>"2.95855"},
+ {cx=>"482.628" , cy=>"285.655" , rx=>"8.13601" , ry=>"8.13601"},
+ {cx=>"476.341" , cy=>"338.54" , rx=>"6.28692" , ry=>"6.28692"},
+ {cx=>"478.19" , cy=>"202.816" , rx=>"6.65674" , ry=>"6.65674"},
+ {cx=>"561.4" , cy=>"207.624" , rx=>"7.76619" , ry=>"7.76619"},
+ {cx=>"548.826" , cy=>"199.118" , rx=>"2.58873" , ry=>"2.21891"},
+ {cx=>"562.509" , cy=>"255.33" , rx=>"5.9171" , ry=>"5.9171"},
+ {cx=>"555.113" , cy=>"269.383" , rx=>"2.21891" , ry=>"2.21891"},
+ {cx=>"565.468" , cy=>"313.022" , rx=>"8.13601" , ry=>"8.13601"},
+ {cx=>"558.811" , cy=>"300.448" , rx=>"3.69819" , ry=>"3.69819"},
+ {cx=>"560.66" , cy=>"351.853" , rx=>"5.54728" , ry=>"5.54728"},
+ {cx=>"574.713" , cy=>"349.634" , rx=>"2.58873" , ry=>"2.58873"},
+ {cx=>"569.905" , cy=>"358.88" , rx=>"2.21891" , ry=>"2.21891"},
+ {cx=>"487.806" , cy=>"347.785" , rx=>"2.21891" , ry=>"2.21891"},
+ {cx=>"488.915" , cy=>"337.06" , rx=>"2.58873" , ry=>"2.58873"},
+ {cx=>"474.122" , cy=>"299.339" , rx=>"4.80764" , ry=>"4.80764"},
+ {cx=>"485.957" , cy=>"303.037" , rx=>"2.58873" , ry=>"2.58873"},
+ {cx=>"472.643" , cy=>"275.67" , rx=>"2.58873" , ry=>"2.58873"},
+ {cx=>"488.176" , cy=>"272.712" , rx=>"2.58873" , ry=>"2.58873"},
+ {cx=>"473.383" , cy=>"237.949" , rx=>"3.32837" , ry=>"3.32837"},
+ {cx=>"487.806" , cy=>"239.798" , rx=>"5.17746" , ry=>"5.17746"},
+ {cx=>"471.164" , cy=>"191.352" , rx=>"3.32837" , ry=>"3.32837"},
+ {cx=>"489.655" , cy=>"192.831" , rx=>"4.06801" , ry=>"4.06801"},
+ {cx=>"501.489" , cy=>"285.286" , rx=>"3.32837" , ry=>"3.32837"} ];
+
+#Draw the ellipses for the H
+my $ellipse_group = $svg->group(id=>'ellipse_group',transform=>$transform,style=>$style);
+
+foreach my $shape (@{$shape_array}) {
+ $svg->ellipse(%$shape,style=>$style);
+}
+
+$points = "617.074,364.474 663.435,173 671.162,173 616.371,379 596,327.5 610.751,327.5";
+
+$style = { 'stroke-miterlimit' =>4,