canvas-text-wrapper
canvas-text-wrapper copied to clipboard
Return object properties
Hello, thank you for the module! It has been useful! Though i find it important to make the method return some properties, like for instance the number of lines, which for what i am going to create a fork
Thank you !
So I noticed that the library does return back a string array broken up in the same way as is rendered on the canvas. So I used that to estimate the height of the block of text.
I'm using typescript and Angular:
import * as Ctw from 'canvas-text-wrapper';
...
const lines: string[] = Ctw.CanvasTextWrapper(canvas, text, options) as any;