tags:

views:

111

answers:

1

Before I go ahead and try to code my own, are there any functions / libraries for PHP which will generate SVG images with text wrapped to a bounding box?

I'm looking for a function which will accept a string and a bonding box, along the lines of: wrapText($text,$x,$y,$width)

So if $text were "The Quick Brown Fox Jumped Over The Lazy Dog" and $width were 125, the SVG file might show:

The Quick Brown
Fox Jumped
Over The Lazy
Dog.

This XML.com article looks like what I'd use, but it's ECMAScript built into the SVG. I'm looking for something that generates pure SVG with no scripts (so it could be read by Adobe Illustrator, for example)

Before I re-code their algorithm in PHP, does anything like this already exist?

A: 

Well, even if it sounds a bit as an overkill, you could use Graphviz to generate a trivial graph (one node only).

Roberto Aloi