node-countdown-gif
node-countdown-gif copied to clipboard
createCanvas is not a function
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
Any luck? I faced the same issue!
Hi @GingerDragon7,
Unfortunately not, I gave up and ended up using Arial (-_-). If you find a way around this keep me posted!
Thanks,
Dan
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