Search code examples
svgtext-formatting

How to make SVG respect a text-width and have it break lines accordingly?


Like in HTML, but I'd prefer to not use foreignObject.

This should be a standard-problem so I guess there is a standard-solution, couldn't find one though.

Thanks

Raffael


Solution

  • I rendered the line breaking aided by the PHP-function imagettfbbox(), to measure the line-length.

    Best

    Raffael