1đź‘Ť
CanvasRenderingContext2D.fillText()
draws text in a single line. If you need to break it into multiple lines, you’ll need to split the text and invoke filltext()
multiple times.
As an alternative you may use the Canvas-Txt
library.
Please take a look at this answer https://stackoverflow.com/a/54390661/2358409
Source:stackexchange.com