Word Wrap in Raphael JS / SVG

How do you get words for wrapping inside a box in RaphaelJS? Or in the SVG browser in general?

I found this thread on it, but that makes no sense. They say they use "widthToCharNum", but as far as I can tell, this thread is the only place these words have ever been used on the Internet. They suggest using the attribute "width", but this does not affect.

+5
source share
4 answers

Text packaging is not built into Raphael or the SVG specification. Period. Coming from the world of HTML, I found the lack of text packaging quite shocking.

. . . , , .

+3
+1
0

, , Raphael-paragraph.

This is a small library that allows you to create automatically wrapped multi-line text with maximum width and height restrictions, line height and text style configuration. It is still pretty beta-ish and needs a lot of optimization, but it should work for your purposes.

Use cases and documentation are provided on the GitHub page.

0
source

All Articles