This is actually really two related questions. I would like to create an image of a page from a notepad with some variable text on it in SVG.
Does SVG provide any native text-wrapping capability or do I somehow need to calculate horizontal width of words and break the lines of text myself? How might I do this?
Does SVG provide any native way to wrap a container around text automatically? Or do I need to calculate the vertical height of a block of text and set the height of the container myself? How might I do this?
Edit: if it’s relevant, I will be constructing the SVG string in C#.
There’s no text wrapping capability in SVG 1.1 although it’s being looked at for the upcoming SVG 2.0 specification. The SVG DOM allows you to get the width of text via getComputedTextLength
You can calculate the bounding box of a block of text by calling getBBox