Multi line text Annotation in Paper.js

227 views
Skip to first unread message

priyanka wadhwa

unread,
Nov 6, 2014, 4:45:22 AM11/6/14
to pap...@googlegroups.com
Does PointText or TextItem in Paper.js Supports Multi line text Annotation?

I want to append a new line on pressing enter key during Text annotation, but takes takes me back to the start of the same line.

Can any one guide me with the js of adding new line on pressing enter?

Thanks in advance.

Peter Herdenborg

unread,
Nov 7, 2014, 4:09:36 AM11/7/14
to pap...@googlegroups.com
Hi Priyanka,

Last time I checked, and judging from previous similar questions to this list, there is not yet any multi line text support in Paperjs. I think you will have to create a new PointText/TextItem on Enter, and offset it vertically from the first using a sensible "line height" offset. If you want automatic wrapping, you can use the native canvasElement.getContext('2d').measureText(text) to detect when a certain text width has been achieved.

Best,
Peter
--
You received this message because you are subscribed to the Google Groups "Paper.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to paperjs+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages