Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

createCanvas is not a function #4

Open
baskeyx opened this issue Aug 22, 2019 · 3 comments
Open

createCanvas is not a function #4

baskeyx opened this issue Aug 22, 2019 · 3 comments

Comments

@baskeyx
Copy link

baskeyx commented Aug 22, 2019

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
Copy link

Any luck? I faced the same issue!

@baskeyx
Copy link
Author

baskeyx commented Nov 20, 2019

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants