ExtendCanvas
Add some useful methods on CanvasRenderingContext2D.prototype
features
- toLines: make long text to lines
- wrapText: this method extend fillText,when fixed width it’ll automatic wrap text
example
warpText
let longText = 'this is long long long long long text'let canvas = documentcanvaswidth = 750canvasheight = 1334let context = canvascontextfillStyle = '#000'contextfont = '48px PingFang SC'contexttextBaseline = 'hanging'context