Create image from text
npm install text2image
npm i text2image
`
Usage:
`js
const text2image = require('text2image')
`
Load font
`js
const font = text2image.loadFont('path/to/font.ttf')
`
Converting text to image
`js
// PNG
text2image.convert(font, 'Hello, World!', 0, 0, 72).then(buffer => {
fs.writeFileSync('hello_world.png', buffer) // })
// SVG
text2image.convert(font, 'Hello, World!', 0, 0, 72, { useSvg: true }).then(buffer => {
fs.writeFileSync('hello_world.svg', buffer) // })
``