nouns image background

This commit is contained in:
Avris 2020-12-01 20:35:23 +01:00
parent 324e057a93
commit 88bb71c73f
2 changed files with 2 additions and 3 deletions

View File

@ -152,9 +152,8 @@ router.get('/nouns/:word.png', async (req, res) => {
const canvas = createCanvas(width, height); const canvas = createCanvas(width, height);
const context = canvas.getContext('2d'); const context = canvas.getContext('2d');
context.fillStyle = '#fff'; const bg = await loadImage('static/bg.png');
context.fillRect(0, 0, width, height); context.drawImage(bg, 0, 0, width, height);
context.fillStyle = '#000';
context.font = 'bold 64pt Quicksand'; context.font = 'bold 64pt Quicksand';
context.fillText(base, width / 2 - context.measureText(base).width / 2, 120); context.fillText(base, width / 2 - context.measureText(base).width / 2, 120);

BIN
static/bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB