Skip to content

Nurutomo/text2image

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

text2image

Hits

Installation:

npm i text2image

Usage:

const text2image = require('text2image')

Load font

const font = text2image.loadFont('path/to/font.ttf')

Converting text to image

// PNG
text2image.convert(font, 'Hello, World!', 0, 0, 72).then(buffer => {
    fs.writeFileSync('hello_world.png', buffer) // <Buffer 89 50 4e ...
})
 
// SVG
text2image.convert(font, 'Hello, World!', 0, 0, 72, { useSvg: true }).then(buffer => {
    fs.writeFileSync('hello_world.svg', buffer) // <Buffer 3c 73 76 ...
})

About

Convert Text to Image

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published