Nooshu / node-countdown-gif

Using Node to generate a countdown Gif. Serve or download it as required.
MIT License
74 stars 55 forks source link

createCanvas is not a function #4

Open baskeyx opened 5 years ago

baskeyx commented 5 years ago

Hey, firstly I love this build and have managed to deploy it to Heroku!

I was looking at adding web fonts support and have been looking at the registerFont utility method. However if I tweak the code from:

const Canvas = require('canvas'); ........ this.canvas = new Canvas(this.width, this.height);

To either:

const Canvas = require('canvas'); ........ this.canvas = Canvas.createCanvas(this.width, this.height);

or:

const { createCanvas } = require('canvas'); ........ this.canvas = createCanvas(this.width, this.height);

I get an error telling me that createCanvas is not a function, the same if I add registerFont.

I'm using canvas 2.6.0 and node 11.8.0, any ideas?

Thanks,

Dan

GingerDragon7 commented 4 years ago

Any luck? I faced the same issue!

baskeyx commented 4 years ago

Hi @GingerDragon7,

Unfortunately not, I gave up and ended up using Arial (-_-). If you find a way around this keep me posted!

Thanks,

Dan

Shahzad6077 commented 2 years ago

Hi @GingerDragon7,

Unfortunately not, I gave up and ended up using Arial (-_-). If you find a way around this keep me posted!

Thanks,

Dan

https://github.com/Automattic/node-canvas/#registerfont