Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/scientific-dev/emoji-canvas
An easy to use module to write text with parsed emojis (supports discord emojis too) in canvas for deno!
https://github.com/scientific-dev/emoji-canvas
canvas deno emojis
Last synced: about 1 month ago
JSON representation
An easy to use module to write text with parsed emojis (supports discord emojis too) in canvas for deno!
- Host: GitHub
- URL: https://github.com/scientific-dev/emoji-canvas
- Owner: scientific-dev
- License: mit
- Created: 2021-04-05T07:03:46.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-08-16T10:02:51.000Z (over 3 years ago)
- Last Synced: 2024-11-16T13:46:49.337Z (about 2 months ago)
- Topics: canvas, deno, emojis
- Language: TypeScript
- Homepage: https://deno.land/x/emoji_canvas
- Size: 14.6 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Emoji Canvas
An easy to use module to write text with parsed emojis (supports discord emojis too) in [deno-canvas](https://deno.land/x/[email protected])!
[![](https://www.codefactor.io/repository/github/scientific-dev/emoji-canvas/badge?style=for-the-badge)](https://www.codefactor.io/repository/github/scientific-dev/emoji-canvas)
[![](https://img.shields.io/badge/VIEW-GITHUB-white?style=for-the-badge)](https://github.com/scientific-dev/emoji-canvas)
[![](https://img.shields.io/github/v/tag/scientific-dev/emoji-canvas?style=for-the-badge&label=version)](https://github.com/scientific-dev/emoji-canvas)## Example
```ts
import Canvas, { dataURLtoFile, loadImage } from 'https://deno.land/x/[email protected]/mod.ts';
import fillTextWithEmoji from "https://raw.githubusercontent.com/scientific-dev/emoji-canvas/master/mod.ts";const canvas = Canvas.MakeCanvas(200, 200);
const ctx = canvas.getContext('2d');ctx.fillRect(0, 0, 800 - 20, 800 - 20);
ctx.fillStyle = 'white';
ctx.font = '30px monospace';await fillTextWithEmoji(ctx, 'Hi 🤣', 10, 40);
Deno.writeFileSync("Test.png", dataURLtoFile(canvas.toDataURL()))
```![Example with unicode emojis](https://github.com/scientific-dev/emoji-canvas/blob/master/examples/example_1.png?raw=true)
And using discord emojis!
```ts
await fillTextWithEmoji(ctx, 'Hi <:kek:819597288238088213>', 10, 40);
```![Example with discord emojis](https://github.com/scientific-dev/emoji-canvas/blob/master/examples/example_2.png?raw=true)
> This package was originally created by [@abh80](https://github.com/abh80) for node.js!