canvas-writer
v2.0.1
Published
Wrapper for node-canvas to help with drawing text.
Downloads
8
Maintainers
Readme
canvas-writer
Wrapper for node-canvas to help with drawing text.
Example
const Canvas = require('canvas');
const CanvasWriter = require('canvas-writer');
let picture = new CanvasWriter(new Canvas(200, 200));
picture.write('Hello world! Text that will probably be wrapped onto the next lines because it\'s longer than that -> ', 100, {
font: '16px "Segoe UI"',
style: 'white'
});
console.log(picture.toString());
// Hello world!
// Text that will
// probably be
// wrapped onto
// the next lines
// because it's
// longer than
// that ->
picture.saveFile('./mypicture.png'); // You're done!
Documentation
See the Github wiki for documentation, changelog, and more.