I've been searching through the mailing list archives and it appears that
the way to force a line break is to use a flowLine element.  It also appears
that flowText elements themselves are questionable to use as they will or
might disappear from SVG 1.2.

Currently I'm doing something like:

       Element froot,freg,fpara,frect,fdiv;
       froot = document.createElementNS(flwtxtNS, "flowText");
       froot.setAttributeNS(null,"xml:space","preserve");
       freg = document.createElementNS(flwtxtNS, "flowRegion");
       frect = document.createElementNS(flwtxtNS, "rect");
       frect.setAttributeNS(null, "x", "" + x);
       frect.setAttributeNS(null, "y", "" + y);
       frect.setAttributeNS(null, "width", "" + w);
       frect.setAttributeNS(null, "height", "" + h);
       freg.appendChild(frect);
       fdiv = document.createElementNS(flwtxtNS,"flowDiv");
       fpara = document.createElementNS(flwtxtNS, "flowPara");
       fpara.appendChild(document.createTextNode(text)); // text is a
String containing the content.
       fdiv.appendChild(fpara);
       froot.appendChild(freg);
       froot.appendChild(fdiv);

Then add froot to the document.

Still have to figure out how I'm going to replace LFs in the String with
flowLine elements but should I be looking at a different way to adding text
to the SVG documents I'm creating?

    Phil

--
Visit http://www.darkisle.com for photos of castles, cairns and other
historic sites in the British Isles.

Reply via email to