tspan()
Produces an SVG "tspan"
element.
Syntax
tspan(
x DECIMAL,
y DECIMAL,
dx STRING,
dy STRING,
style STRING,
content STRING )
RETURNS om.DomNode
- x defines the X position of the tspan element.
y
defines the Y position of the tspan element .dx
defines the delta-X for horizontal positionning of the tspan element.dy
defines the delta-Y for vertical positionning of the tspan element.- style defines the in-line style to be applied on the tspan element.
- content is the actual text.
Usage
This function creates a "tspan"
SVG DOM element from the parameters.
A tspan element can be used to draw multiple lines of text in SVG.
The DOM nodes created by this function must be added to in a "text"
element
produced by the text()
function.
Example
DEFINE root_svg, t om.DomNode
...
LET t = fglsvgcanvas.text(NULL,200,NULL,"style_2")
CALL root_svg.appendChild( t )
CALL t.appendChild( fglsvgcanvas.tspan(120,NULL,NULL,30,NULL,"First line" ) )
CALL t.appendChild( fglsvgcanvas.tspan(120,NULL,NULL,30,NULL,"Second line" ) )