Do you have an idea how to create a multiline label with draw2d's draw2d.shape.basic.Label
Asked
Active
Viewed 1,020 times
1

Konstantin Dinev
- 34,219
- 14
- 75
- 100

Alexander Stefanov
- 514
- 3
- 11
-
fwiw, [fabric.js](http://fabricjs.com) has support for multiline text out of the box. – kangax Mar 03 '13 at 18:15
2 Answers
1
This library is using the HTML5 Canvas API. In order to draw text it is using the fillText()
method which does not have multi-line support out of the box. In order to achieve such the text needs to be broken down into multiple labels, which I don't think this library has support for.

Konstantin Dinev
- 34,219
- 14
- 75
- 100
-
is it using Canvas API? From what I know, it uses SVG/VML, since it is based on Raphael. And, as @alexander-stefanov says, it can be done programatically, I've actually tried that - it inserts two `
` elements in the ` – zaboco Feb 27 '14 at 15:49 -
What do you mean by "it can be done programatically". Can you please post an example? How can I "break it down into multiple labels"? – user3142695 Jul 11 '14 at 21:31
1
Actually, you can make a multiline label (at least visually) by setting label's text programatically with '\n' in it. Like label.setText('Some \n text')
. But you can't do it 'manually', since you're typing in an <input type="text">

Alexander Stefanov
- 514
- 3
- 11