- From: Martin Molema via GitHub <noreply@w3.org>
- Date: Thu, 08 Jan 2026 10:17:53 +0000
- To: public-svg-issues@w3.org
I use SVGs a lot and use it a lot to draw flowcharts etc. using boxes with texts. The main problem is automatic text flow within a certain rectangle. This requires a definition of the bounding box. The current <text> element only has (x,y) and no width / height definition. The definition of a bounding box could be achieved using a nested SVG containing only the <text> element. But by my knowlegde the browsers will ignore that. I did have a look at the given Codepen for linebreaks, but this implies you already know where linebreaks should be. This is exactly my problem. One way or another the rendering of a <text> element should be aware of size constraints. The client (browser, apps like Inkscape, DrawIO?) can then deduce how to make the text flow inside those constraints. Maybe even taking into account the alignment (center, left, right)? This enables a much wanted way to generate SVG: in isolation without actually having a browser. Now, one has to measure actual text-sizes so one can manually break up a string in multiple lines by adding a word, measuring the actual size and adding the next word etc. So, if I should want to create an SVG element without a browser/renderer this is impossible and leads to ugly solutions like making a one-pixel SVG in my browser to make my algorithm work. So yes, a big thumbs-up for this feature! -- GitHub Notification of comment by martinmolema Please view or discuss this issue at https://github.com/w3c/svgwg/issues/942#issuecomment-3723178006 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Thursday, 8 January 2026 10:17:54 UTC