Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

jimpfont

Sworder7118Apache-2.0deprecated0.0.6

this package has been deprecated

A Simple module for using .ttf font on Jimp

npm, jimp, ttf, generator

readme

JimpFONT

JimpFONT

NPM version NPM downloads

npm installnfo

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
    });
});