text_tref()

Produces the SVG "text" element with a "tref" sub-element.

Syntax

text_tref(
   x DECIMAL,
   y DECIMAL,
   tref STRING,
   class STRING )
  RETURNS om.DomNode
  1. x and y define the position of the text.
  2. tref is the xlink reference to the tref.
  3. class defines a reference to a CSS style.

Usage

This function creates a "text" SVG DOM element from the parameters, including a "tref" sub-element that references a "text" element defined in a "defs" element.

The tref parameter is used to build an "xlink:href=#path" reference.

The "text" element referenced by the "tref" attribute must be defined in a "defs" element, created with the defs() function.

To specify the text font attributes, define a CSS style in a defs() element with the styleList() function, and reference the text style in the class parameter of this function.

Example

DEFINE root_svg, defs, t, n om.DomNode
...
LET defs = fglsvgcanvas.defs( NULL )
CALL root_svg.appendChild( defs )
...
CALL defs.appendChild( t:=fglsvgcanvas.text( NULL, NULL,
                       "The is the referenced text..." ) )
CALL t.setAttribute("id","text_1")
LET n = fglsvgcanvas.text_tref(10,20,"text_1","style_4")
...