README
A Simple module for using .ttf font on Jimp
Installation
To use JimpFONT, install GraphicsMagick.
$ npm install jimpfont
Example usage
const Jimp = require("jimp");
const JimpFONT = require("jimpfont");
const jimpFONT = new JimpFONT();
new Jimp(80, 30, async(err, image) => {
let text = await jimpFONT.CreateFont("Sworder", 80, 30, "./assets/fonts/Font.ttf", 20, "#FFFFFF"); //Text, width, height, path, size, HexaColor
image.composite(text, 0, 0);
image.getBuffer(Jimp.MIME_PNG, async (err, buffer) => {
if (err) console.log(err);
return buffer; //Buffer
});
});