module:MultiLineText(x, y, w, h, text, size, coloropt)

Multi line text element in SVG

Multi line text is not natively supportend in SVG 1.1, the workaround is to use the element and display a HTML paragraph inside of the SVG document.

Because this technique is not supported by all of the browsers, the foreignObject element is wrapped in , which provides fallback for those cases.

read more: foreignObject on MDN web docs

new module:MultiLineText(x, y, w, h, text, size, coloropt)

Parameters:
Name Type Attributes Default Description
x number

horizontal position in SVG pixels

y number

vertical position in SVG pixels

w number

width of the text box in SVG pixels

h number

height of the text box in SVG pixels

text number

text content of the text box

size string

CSS font size of the text

color String <optional>
"black"

color of the text

Extends

  • Tag