1.0.0 • Published 2 years ago

filltext-for-twemoji v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

fillText-for-twemoji-node-canvas


npm node.js npm GitHub issues GitHub forks GitHub stars GitHub license

This package adds twemoji to node-canvas.

Highlight

  • Layout that does not collapse

  • Support for newlines

Install

npm install filltext-for-twemoji

Usage

const Canvas = require('canvas');
const { fillText } = require('filltext-for-twemoji');

(async () => {
    const canvas = Canvas.createCanvas(300, 200);
    const ctx = canvas.getContext('2d');
    ctx.font = '40px "sans-serif"';
    await fillText(ctx, 'Hello😁twemoji', 15, 110);
})();

result

The font property is applied, but the textAlign and textBaseline settings are ignored and 'start' and 'alphabetic' are applied respectively. Note that no other settings are supported.

Issues

If you find a bug or problem, please open an issue!:bug: In particular, let me know if there are any symbols you can't draw well.

Author

LICENSE

This project is licensed under the MIT License - see the LICENSE file for details.