canvas-writer

2.0.1 • Public • Published

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.

Package Sidebar

Install

npm i canvas-writer

Weekly Downloads

3

Version

2.0.1

License

MIT

Last publish

Collaborators

  • 1computer