jimpfontdeprecated

A Simple module for using .ttf font on Jimp

Usage no npm install needed!

<script type="module">
  import jimpfont from 'https://cdn.skypack.dev/jimpfont';
</script>

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