Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / perl-5.8.0 / man / man3 / SVG::Element.3
.\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. | will give a
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
.\" expand to `' in nroff, nothing in troff, for use with C<>.
.tr \(*W-|\(bv\*(Tr
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
'br\}
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
.\"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.hy 0
.if n .na
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "SVG::Element 3"
.TH SVG::Element 3 "2003-11-02" "perl v5.8.0" "User Contributed Perl Documentation"
.SH "NAME"
SVG::Element \- Generate the element bits for SVG.pm
.SH "AUTHOR"
.IX Header "AUTHOR"
Ronan Oger, ronan@roasp.com
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fIperl\fR\|(1),\s-1SVG\s0,\s-1SVG::XML\s0,SVG::Element,SVG::Parser, SVG::Manual
http://www.roasp.com/
http://www.perlsvg.com/
http://www.roitsystems.com/
http://www.w3c.org/Graphics/SVG/
.Sh "tag (alias: element)"
.IX Subsection "tag (alias: element)"
$tag = \f(CW$SVG\fR\->tag($name, \f(CW%attributes\fR)
.PP
Generic element generator. Creates the element named \f(CW$name\fR with the attributes
specified in \f(CW%attributes\fR. This method is the basis of most of the explicit
element generators.
.PP
\&\fBExample:\fR
.PP
.Vb 1
\& my $tag = $SVG->tag('g', transform=>'rotate(-45)');
.Ve
.Sh "anchor"
.IX Subsection "anchor"
$tag = \f(CW$SVG\fR\->anchor(%attributes)
.PP
Generate an anchor element. Anchors are put around objects to make them
\&'live' (i.e. clickable). It therefore requires a drawn object or group element
as a child.
.PP
\&\fBExample:\fR
.PP
.Vb 6
\& # generate an anchor
\& $tag = $SVG->anchor(
\& -href=>'http://here.com/some/simpler/SVG.SVG'
\& );
\& # add a circle to the anchor. The circle can be clicked on.
\& $tag->circle(cx=>10,cy=>10,r=>1);
.Ve
.PP
.Vb 5
\& # more complex anchor with both URL and target
\& $tag = $SVG->anchor(
\& -href => 'http://somewhere.org/some/other/page.html',
\& -target => 'new_window'
\& );
.Ve
.Sh "circle"
.IX Subsection "circle"
$tag = \f(CW$SVG\fR\->circle(%attributes)
.PP
Draw a circle at (cx,cy) with radius r.
.PP
\&\fBExample:\fR
.PP
.Vb 1
\& my $tag = $SVG->circlecx=>4, cy=>2, r=>1);
.Ve
.Sh "ellipse"
.IX Subsection "ellipse"
$tag = \f(CW$SVG\fR\->ellipse(%attributes)
.PP
Draw an ellipse at (cx,cy) with radii rx,ry.
.PP
\&\fBExample:\fR
.PP
.Vb 12
\& my $tag = $SVG->ellipse(
\& cx=>10, cy=>10,
\& rx=>5, ry=>7,
\& id=>'ellipse',
\& style=>{
\& 'stroke'=>'red',
\& 'fill'=>'green',
\& 'stroke-width'=>'4',
\& 'stroke-opacity'=>'0.5',
\& 'fill-opacity'=>'0.2'
\& }
\& );
.Ve
.Sh "rectangle (alias: rect)"
.IX Subsection "rectangle (alias: rect)"
$tag = \f(CW$SVG\fR\->rectangle(%attributes)
.PP
Draw a rectangle at (x,y) with width 'width' and height 'height' and side radii
\&'rx' and 'ry'.
.PP
\&\fBExample:\fR
.PP
.Vb 6
\& $tag = $SVG->rectangle(
\& x=>10, y=>20,
\& width=>4, height=>5,
\& rx=>5.2, ry=>2.4,
\& id=>'rect_1'
\& );
.Ve
.Sh "image"
.IX Subsection "image"
.Vb 1
\& $tag = $SVG->image(%attributes)
.Ve
.PP
Draw an image at (x,y) with width 'width' and height 'height' linked to image
resource '\-href'. See also \*(L"use\*(R".
.PP
\&\fBExample:\fR
.PP
.Vb 6
\& $tag = $SVG->image(
\& x=>100, y=>100,
\& width=>300, height=>200,
\& '-href'=>"image.png", #may also embed SVG, e.g. "image.SVG"
\& id=>'image_1'
\& );
.Ve
.PP
\&\fBOutput:\fR
.PP
.Vb 1
\& <image xlink:href="image.png" x="100" y="100" width="300" height="200"/>
.Ve
.Sh "use"
.IX Subsection "use"
$tag = \f(CW$SVG\fR\->use(%attributes)
.PP
Retrieve the content from an entity within an \s-1SVG\s0 document and apply it at
(x,y) with width 'width' and height 'height' linked to image resource '\-href'.
.PP
\&\fBExample:\fR
.PP
.Vb 6
\& $tag = $SVG->use(
\& x=>100, y=>100,
\& width=>300, height=>200,
\& '-href'=>"pic.SVG#image_1",
\& id=>'image_1'
\& );
.Ve
.PP
\&\fBOutput:\fR
.PP
.Vb 1
\& <use xlink:href="pic.SVG#image_1" x="100" y="100" width="300" height="200"/>
.Ve
.PP
According to the \s-1SVG\s0 specification, the 'use' element in \s-1SVG\s0 can point to a
single element within an external \s-1SVG\s0 file.
.Sh "polygon"
.IX Subsection "polygon"
$tag = \f(CW$SVG\fR\->polygon(%attributes)
.PP
Draw an n\-sided polygon with vertices at points defined by a string of the form
\&'x1,y1,x2,y2,x3,y3,... xy,yn'. The \*(L"get_path\*(R" method is provided as a
convenience to generate a suitable string from coordinate data.
.PP
\&\fBExample:\fR
.PP
.Vb 3
\& # a five-sided polygon
\& my $xv = [0,2,4,5,1];
\& my $yv = [0,0,2,7,5];
.Ve
.PP
.Vb 4
\& $points = $a->get_path(
\& x=>$xv, y=>$yv,
\& -type=>'polygon'
\& );
.Ve
.PP
.Vb 5
\& $c = $a->polygon(
\& %$points,
\& id=>'pgon1',
\& style=>\e%polygon_style
\& );
.Ve
.PP
\&\s-1SEE\s0 \s-1ALSO:\s0
.PP
\&\*(L"polyline\*(R", \*(L"path\*(R", \*(L"get_path\*(R".
.Sh "polyline"
.IX Subsection "polyline"
$tag = \f(CW$SVG\fR\->polyline(%attributes)
.PP
Draw an n\-point polyline with points defined by a string of the form
\&'x1,y1,x2,y2,x3,y3,... xy,yn'. The \*(L"get_path\*(R" method is provided as a
convenience to generate a suitable string from coordinate data.
.PP
\&\fBExample:\fR
.PP
.Vb 3
\& # a 10-pointsaw-tooth pattern
\& my $xv = [0,1,2,3,4,5,6,7,8,9];
\& my $yv = [0,1,0,1,0,1,0,1,0,1];
.Ve
.PP
.Vb 5
\& $points = $a->get_path(
\& x=>$xv, y=>$yv,
\& -type=>'polyline',
\& -closed=>'true' #specify that the polyline is closed.
\& );
.Ve
.PP
.Vb 8
\& my $tag = $a->polyline (
\& %$points,
\& id=>'pline_1',
\& style=>{
\& 'fill-opacity'=>0,
\& 'stroke-color'=>'rgb(250,123,23)'
\& }
\& );
.Ve
.Sh "line"
.IX Subsection "line"
$tag = \f(CW$SVG\fR\->line(%attributes)
.PP
Draw a straight line between two points (x1,y1) and (x2,y2).
.PP
\&\fBExample:\fR
.PP
.Vb 5
\& my $tag = $SVG->line(
\& id=>'l1',
\& x1=>0, y1=>10,
\& x2=>10, y2=>0
\& );
.Ve
.PP
To draw multiple connected lines, use \*(L"polyline\*(R".
.Sh "text"
.IX Subsection "text"
$text = \f(CW$SVG\fR\->text(%attributes)\->\fIcdata()\fR;
.PP
$text_path = \f(CW$SVG\fR\->text(\-type=>'path');
\&\f(CW$text_span\fR = \f(CW$text_path\fR\->text(\-type=>'span')\->cdata('A');
\&\f(CW$text_span\fR = \f(CW$text_path\fR\->text(\-type=>'span')\->cdata('B');
\&\f(CW$text_span\fR = \f(CW$text_path\fR\->text(\-type=>'span')\->cdata('C');
.PP
define the container for a text string to be drawn in the image.
.PP
\&\fBInput:\fR
\-type = path type (path | polyline | polygon)
\-type = text element type (path | span | normal [default])
.PP
\&\fBExample:\fR
.PP
.Vb 3
\& my $text1 = $SVG->text(
\& id=>'l1', x=>10, y=>10
\& )->cdata('hello, world');
.Ve
.PP
.Vb 2
\& my $text2 = $SVG->text(
\& id=>'l1', x=>10, y=>10, -cdata=>'hello, world');
.Ve
.PP
.Vb 4
\& my $text = $SVG->text(
\& id=>'tp', x=>10, y=>10 -type=>path)
\& ->text(id=>'ts' -type=>'span')
\& ->cdata('hello, world');
.Ve
.PP
\&\s-1SEE\s0 \s-1ALSO:\s0
.PP
.Vb 1
\& L<"desc">, L<"cdata">.
.Ve
.Sh "title"
.IX Subsection "title"
$tag = \f(CW$SVG\fR\->title(%attributes)
.PP
Generate the title of the image.
.PP
\&\fBExample:\fR
.PP
.Vb 1
\& my $tag = $SVG->title(id=>'document-title')->cdata('This is the title');
.Ve
.Sh "desc"
.IX Subsection "desc"
$tag = \f(CW$SVG\fR\->desc(%attributes)
.PP
Generate the description of the image.
.PP
\&\fBExample:\fR
.PP
.Vb 1
\& my $tag = $SVG->desc(id=>'document-desc')->cdata('This is a description');
.Ve
.Sh "comment"
.IX Subsection "comment"
$tag = \f(CW$SVG\fR\->comment(@comments)
.PP
Generate the description of the image.
.PP
\&\fBExample:\fR
.PP
.Vb 1
\& my $tag = $SVG->comment('comment 1','comment 2','comment 3');
.Ve
.PP
$tag = \f(CW$SVG\fR\->pi(@pi)
.PP
Generate a set of processing instructions
.PP
\&\fBExample:\fR
.PP
.Vb 1
\& my $tag = $SVG->pi('instruction one','instruction two','instruction three');
.Ve
.PP
.Vb 4
\& returns:
\& <lt>?instruction one?<gt>
\& <lt>?instruction two?<gt>
\& <lt>?instruction three?<gt>
.Ve
.Sh "script"
.IX Subsection "script"
$tag = \f(CW$SVG\fR\->script(%attributes)
.PP
Generate a script container for dynamic (client\-side) scripting using
ECMAscript, Javascript or other compatible scripting language.
.PP
\&\fBExample:\fR
.PP
.Vb 1
\& my $tag = $SVG->script(-type=>"text/ecmascript");
.Ve
.PP
.Vb 4
\& # populate the script tag with cdata
\& # be careful to manage the javascript line ends.
\& # qq|text| or qqยงtextยง where text is the script
\& # works well for this.
.Ve
.PP
.Vb 7
\& $tag->cdata(qq|function d(){
\& //simple display function
\& for(cnt = 0; cnt < d.length; cnt++)
\& document.write(d[cnt]);//end for loop
\& document.write("<BR>");//write a line break
\& }|
\& );
.Ve
.Sh "path"
.IX Subsection "path"
$tag = \f(CW$SVG\fR\->path(%attributes)
.PP
Draw a path element. The path vertices may be imputed as a parameter or
calculated usingthe \*(L"get_path\*(R" method.
.PP
\&\fBExample:\fR
.PP
.Vb 3
\& # a 10-pointsaw-tooth pattern drawn with a path definition
\& my $xv = [0,1,2,3,4,5,6,7,8,9];
\& my $yv = [0,1,0,1,0,1,0,1,0,1];
.Ve
.PP
.Vb 6
\& $points = $a->get_path(
\& x => $xv,
\& y => $yv,
\& -type => 'path',
\& -closed => 'true' #specify that the polyline is closed
\& );
.Ve
.PP
.Vb 9
\& $tag = $SVG->path(
\& %$points,
\& id => 'pline_1',
\& style => {
\& 'fill-opacity' => 0,
\& 'fill-color' => 'green',
\& 'stroke-color' => 'rgb(250,123,23)'
\& }
\& );
.Ve
.PP
\&\s-1SEE\s0 \s-1ALSO:\s0
.PP
\&\*(L"get_path\*(R".
.Sh "get_path"
.IX Subsection "get_path"
$path = \f(CW$SVG\fR\->get_path(%attributes)
.PP
Returns the text string of points correctly formatted to be incorporated into
the multi-point \s-1SVG\s0 drawing object definitions (path, polyline, polygon)
.PP
\&\fBInput:\fR attributes including:
.PP
.Vb 3
\& -type = path type (path | polyline | polygon)
\& x = reference to array of x coordinates
\& y = reference to array of y coordinates
.Ve
.PP
\&\fBOutput:\fR a hash reference consisting of the following key-value pair:
.PP
.Vb 4
\& points = the appropriate points-definition string
\& -type = path|polygon|polyline
\& -relative = 1 (define relative position rather than absolute position)
\& -closed = 1 (close the curve - path and polygon only)
.Ve
.PP
\&\fBExample:\fR
.PP
.Vb 3
\& #generate an open path definition for a path.
\& my ($points,$p);
\& $points = $SVG->get_path(x=&gt\e@x,y=&gt\e@y,-relative=&gt1,-type=&gt'path');
.Ve
.PP
.Vb 2
\& #add the path to the SVG document
\& my $p = $SVG->path(%$path, style=>\e%style_definition);
.Ve
.PP
.Vb 8
\& #generate an closed path definition for a a polyline.
\& $points = $SVG->get_path(
\& x=>\e@x,
\& y=>\e@y,
\& -relative=>1,
\& -type=>'polyline',
\& -closed=>1
\& ); # generate a closed path definition for a polyline
.Ve
.PP
.Vb 2
\& # add the polyline to the SVG document
\& $p = $SVG->polyline(%$points, id=>'pline1');
.Ve
.PP
\&\fBAliases:\fR get_path set_path
.Sh "animate"
.IX Subsection "animate"
$tag = \f(CW$SVG\fR\->animate(%attributes)
.PP
Generate an \s-1SMIL\s0 animation tag. This is allowed within any nonempty tag. Refer\e
to the W3C for detailed information on the subtleties of the animate \s-1SMIL\s0
commands.
.PP
\&\fBInputs:\fR \-method = Transform | Motion | Color
.PP
.Vb 3
\& my $an_ellipse = $SVG->ellipse(
\& cx=>30,cy=>150,rx=>10,ry=>10,id=>'an_ellipse',
\& stroke=>'rgb(130,220,70)',fill=>'rgb(30,20,50)');
.Ve
.PP
.Vb 2
\& $an_ellipse-> animate(
\& attributeName=>"cx",values=>"20; 200; 20",dur=>"10s", repeatDur=>'indefinite');
.Ve
.PP
.Vb 3
\& $an_ellipse-> animate(
\& attributeName=>"rx",values=>"10;30;20;100;50",
\& dur=>"10s", repeatDur=>'indefinite');
.Ve
.PP
.Vb 3
\& $an_ellipse-> animate(
\& attributeName=>"ry",values=>"30;50;10;20;70;150",
\& dur=>"15s", repeatDur=>'indefinite');
.Ve
.PP
.Vb 3
\& $an_ellipse-> animate(
\& attributeName=>"rx",values=>"30;75;10;100;20;20;150",
\& dur=>"20s", repeatDur=>'indefinite');
.Ve
.PP
.Vb 3
\& $an_ellipse-> animate(
\& attributeName=>"fill",values=>"red;green;blue;cyan;yellow",
\& dur=>"5s", repeatDur=>'indefinite');
.Ve
.PP
.Vb 3
\& $an_ellipse-> animate(
\& attributeName=>"fill-opacity",values=>"0;1;0.5;0.75;1",
\& dur=>"20s",repeatDur=>'indefinite');
.Ve
.PP
.Vb 3
\& $an_ellipse-> animate(
\& attributeName=>"stroke-width",values=>"1;3;2;10;5",
\& dur=>"20s",repeatDur=>'indefinite');
.Ve
.Sh "group"
.IX Subsection "group"
$tag = \f(CW$SVG\fR\->group(%attributes)
.PP
Define a group of objects with common properties. groups can have style,
animation, filters, transformations, and mouse actions assigned to them.
.PP
\&\fBExample:\fR
.PP
.Vb 9
\& $tag = $SVG->group(
\& id => 'xvs000248',
\& style => {
\& 'font' => [ qw( Arial Helvetica sans ) ],
\& 'font-size' => 10,
\& 'fill' => 'red',
\& },
\& transform => 'rotate(-45)'
\& );
.Ve
.Sh "defs"
.IX Subsection "defs"
$tag = \f(CW$SVG\fR\->defs(%attributes)
.PP
define a definition segment. A Defs requires children when defined using \s-1SVG\s0.pm
\&\fBExample:\fR
.PP
.Vb 1
\& $tag = $SVG->defs(id => 'def_con_one',);
.Ve
.Sh "style"
.IX Subsection "style"
$SVG\->style(%styledef)
.PP
Sets/Adds style-definition for the following objects being created.
.PP
Style definitions apply to an object and all its children for all properties for
which the value of the property is not redefined by the child.
.Sh "mouseaction"
.IX Subsection "mouseaction"
$SVG\->mouseaction(%attributes)
.PP
Sets/Adds mouse action definitions for tag
.PP
$SVG\->attrib($name, \f(CW$value\fR)
.PP
Sets/Adds attributes of an element.
.PP
Retrieve an attribute:
.PP
.Vb 1
\& $svg->attrib($name);
.Ve
.PP
Set a scalar attribute:
.PP
.Vb 1
\& $SVG->attrib $name, $value
.Ve
.PP
Set a list attribute:
.PP
.Vb 1
\& $SVG->attrib $name, \e@value
.Ve
.PP
Set a hash attribute (i.e. style definitions):
.PP
.Vb 1
\& $SVG->attrib $name, \e%value
.Ve
.PP
Remove an attribute:
.PP
.Vb 1
\& $svg->attrib($name,undef);
.Ve
.PP
\&\fBAliases:\fR attr attribute
.Sh "cdata"
.IX Subsection "cdata"
$SVG\->cdata($text)
.PP
Sets cdata to \f(CW$text\fR. \s-1SVG\s0.pm allows you to set cdata for any tag. If the tag is
meant to be an empty tag, \s-1SVG\s0.pm will not complain, but the rendering agent will
fail. In the \s-1SVG\s0 \s-1DTD\s0, cdata is generally only meant for adding text or script
content.
.PP
\&\fBExample:\fR
.PP
.Vb 5
\& $SVG->text(
\& style => {
\& 'font' => 'Arial',
\& 'font-size' => 20
\& })->cdata('SVG.pm is a perl module on CPAN!');
.Ve
.PP
.Vb 2
\& my $text = $SVG->text(style=>{'font'=>'Arial','font-size'=>20});
\& $text->cdata('SVG.pm is a perl module on CPAN!');
.Ve
.PP
\&\fBResult:\fR
.PP
.Vb 1
\& E<lt>text style="font: Arial; font-size: 20" E<gt>SVG.pm is a perl module on CPAN!E<lt>/text E<gt>
.Ve
.PP
\&\s-1SEE\s0 \s-1ALSO:\s0
.PP
.Vb 1
\& L<"CDATA"> L<"desc">, L<"title">, L<"text">, L<"script">.
.Ve
.Sh "\s-1CDATA\s0"
.IX Subsection "CDATA"
.Vb 2
\& $script = $SVG->script();
\& $script->CDATA($text);
.Ve
.PP
Generates a <![CDATA[ ... ]]> tag with the contents of \f(CW$text\fR rendered exactly as supplied. \s-1SVG\s0.pm allows you to set cdata for any tag. If the tag is
meant to be an empty tag, \s-1SVG\s0.pm will not complain, but the rendering agent will
fail. In the \s-1SVG\s0 \s-1DTD\s0, cdata is generally only meant for adding text or script
content.
.PP
\&\fBExample:\fR
.PP
.Vb 4
\& my $text = qqยง
\& var SVGDoc;
\& var groups = new Array();
\& var last_group;
.Ve
.PP
.Vb 15
\& /*****
\& *
\& * init
\& *
\& * Find this SVG's document element
\& * Define members of each group by id
\& *
\& *****/
\& function init(e) {
\& SVGDoc = e.getTarget().getOwnerDocument();
\& append_group(1, 4, 6); // group 0
\& append_group(5, 4, 3); // group 1
\& append_group(2, 3); // group 2
\& }ยง;
\& $SVG->script()->CDATA($text);
.Ve
.PP
\&\fBResult:\fR
.PP
.Vb 5
\& E<lt>script E<gt>
\& <gt>![CDATA[
\& var SVGDoc;
\& var groups = new Array();
\& var last_group;
.Ve
.PP
.Vb 15
\& /*****
\& *
\& * init
\& *
\& * Find this SVG's document element
\& * Define members of each group by id
\& *
\& *****/
\& function init(e) {
\& SVGDoc = e.getTarget().getOwnerDocument();
\& append_group(1, 4, 6); // group 0
\& append_group(5, 4, 3); // group 1
\& append_group(2, 3); // group 2
\& }
\& ]]E<gt>
.Ve
.PP
\&\s-1SEE\s0 \s-1ALSO:\s0
.PP
.Vb 1
\& L<"cdata">, L<"script">.
.Ve
.Sh "filter"
.IX Subsection "filter"
$tag = \f(CW$SVG\fR\->filter(%attributes)
.PP
Generate a filter. Filter elements contain \*(L"fe\*(R" filter sub\-elements.
.PP
\&\fBExample:\fR
.PP
.Vb 8
\& my $filter = $SVG->filter(
\& filterUnits=>"objectBoundingBox",
\& x=>"-10%",
\& y=>"-10%",
\& width=>"150%",
\& height=>"150%",
\& filterUnits=>'objectBoundingBox'
\& );
.Ve
.PP
.Vb 1
\& $filter->fe();
.Ve
.PP
\&\s-1SEE\s0 \s-1ALSO:\s0
.PP
\&\*(L"fe\*(R".
.Sh "fe"
.IX Subsection "fe"
$tag = \f(CW$SVG\fR\->fe(\-type=>'type', \f(CW%attributes\fR)
.PP
Generate a filter sub\-element. Must be a child of a \*(L"filter\*(R" element.
.PP
\&\fBExample:\fR
.PP
.Vb 10
\& my $fe = $SVG->fe(
\& -type => 'DiffuseLighting' # required - element name omiting 'fe'
\& id => 'filter_1',
\& style => {
\& 'font' => [ qw(Arial Helvetica sans) ],
\& 'font-size' => 10,
\& 'fill' => 'red',
\& },
\& transform => 'rotate(-45)'
\& );
.Ve
.PP
Note that the following filter elements are currently supported:
.IP "\(bu feBlend" 4
.IX Item "feBlend"
.PD 0
.IP "\(bu feColorMatrix" 4
.IX Item "feColorMatrix"
.IP "\(bu feComponentTransfer" 4
.IX Item "feComponentTransfer"
.IP "\(bu feComposite" 4
.IX Item "feComposite"
.IP "\(bu feConvolveMatrix" 4
.IX Item "feConvolveMatrix"
.IP "\(bu feDiffuseLighting" 4
.IX Item "feDiffuseLighting"
.IP "\(bu feDisplacementMap" 4
.IX Item "feDisplacementMap"
.IP "\(bu feDistantLight" 4
.IX Item "feDistantLight"
.IP "\(bu feFlood" 4
.IX Item "feFlood"
.IP "\(bu feFuncA" 4
.IX Item "feFuncA"
.IP "\(bu feFuncB" 4
.IX Item "feFuncB"
.IP "\(bu feFuncG" 4
.IX Item "feFuncG"
.IP "\(bu feFuncR" 4
.IX Item "feFuncR"
.IP "\(bu feGaussianBlur" 4
.IX Item "feGaussianBlur"
.IP "\(bu feImage" 4
.IX Item "feImage"
.IP "\(bu feMerge" 4
.IX Item "feMerge"
.IP "\(bu feMergeNode" 4
.IX Item "feMergeNode"
.IP "\(bu feMorphology" 4
.IX Item "feMorphology"
.IP "\(bu feOffset" 4
.IX Item "feOffset"
.IP "\(bu fePointLight" 4
.IX Item "fePointLight"
.IP "\(bu feSpecularLighting" 4
.IX Item "feSpecularLighting"
.IP "\(bu feSpotLight" 4
.IX Item "feSpotLight"
.IP "\(bu feTile" 4
.IX Item "feTile"
.IP "\(bu feTurbulence" 4
.IX Item "feTurbulence"
.PD
.PP
\&\s-1SEE\s0 \s-1ALSO:\s0
.PP
\&\*(L"filter\*(R".
.Sh "pattern"
.IX Subsection "pattern"
$tag = \f(CW$SVG\fR\->pattern(%attributes)
.PP
Define a pattern for later reference by url.
.PP
\&\fBExample:\fR
.PP
.Vb 7
\& my $pattern = $SVG->pattern(
\& id => "Argyle_1",
\& width => "50",
\& height => "50",
\& patternUnits => "userSpaceOnUse",
\& patternContentUnits => "userSpaceOnUse"
\& );
.Ve
.Sh "set"
.IX Subsection "set"
$tag = \f(CW$SVG\fR\->set(%attributes)
.PP
Set a definition for an \s-1SVG\s0 object in one section, to be referenced in other
sections as needed.
.PP
\&\fBExample:\fR
.PP
.Vb 7
\& my $set = $SVG->set(
\& id => "Argyle_1",
\& width => "50",
\& height => "50",
\& patternUnits => "userSpaceOnUse",
\& patternContentUnits => "userSpaceOnUse"
\& );
.Ve
.Sh "stop"
.IX Subsection "stop"
$tag = \f(CW$SVG\fR\->stop(%attributes)
.PP
Define a stop boundary for \*(L"gradient\*(R"
.PP
\&\fBExample:\fR
.PP
.Vb 7
\& my $pattern = $SVG->stop(
\& id => "Argyle_1",
\& width => "50",
\& height => "50",
\& patternUnits => "userSpaceOnUse",
\& patternContentUnits => "userSpaceOnUse"
\& );
.Ve
.PP
$tag = \f(CW$SVG\fR\->gradient(%attributes)
.PP
Define a color gradient. Can be of type \fBlinear\fR or \fBradial\fR
.PP
\&\fBExample:\fR
.PP
.Vb 4
\& my $gradient = $SVG->gradient(
\& -type => "linear",
\& id => "gradient_1"
\& );
.Ve
.SH "GENERIC ELEMENT METHODS"
.IX Header "GENERIC ELEMENT METHODS"
The following elements are generically supported by \s-1SVG:\s0
.IP "\(bu altGlyph" 4
.IX Item "altGlyph"
.PD 0
.IP "\(bu altGlyphDef" 4
.IX Item "altGlyphDef"
.IP "\(bu altGlyphItem" 4
.IX Item "altGlyphItem"
.IP "\(bu clipPath" 4
.IX Item "clipPath"
.IP "\(bu color-profile" 4
.IX Item "color-profile"
.IP "\(bu cursor" 4
.IX Item "cursor"
.IP "\(bu definition-src" 4
.IX Item "definition-src"
.IP "\(bu font-face-format" 4
.IX Item "font-face-format"
.IP "\(bu font-face-name" 4
.IX Item "font-face-name"
.IP "\(bu font-face-src" 4
.IX Item "font-face-src"
.IP "\(bu font-face-url" 4
.IX Item "font-face-url"
.IP "\(bu foreignObject" 4
.IX Item "foreignObject"
.IP "\(bu glyph" 4
.IX Item "glyph"
.IP "\(bu glyphRef" 4
.IX Item "glyphRef"
.IP "\(bu hkern" 4
.IX Item "hkern"
.IP "\(bu marker" 4
.IX Item "marker"
.IP "\(bu mask" 4
.IX Item "mask"
.IP "\(bu metadata" 4
.IX Item "metadata"
.IP "\(bu missing-glyph" 4
.IX Item "missing-glyph"
.IP "\(bu mpath" 4
.IX Item "mpath"
.IP "\(bu switch" 4
.IX Item "switch"
.IP "\(bu symbol" 4
.IX Item "symbol"
.IP "\(bu tref" 4
.IX Item "tref"
.IP "\(bu view" 4
.IX Item "view"
.IP "\(bu vkern" 4
.IX Item "vkern"
.PD
.PP
See e.g. \*(L"pattern\*(R" for an example of the use of these methods.