You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was previously using an install of canvas from his fork as dependency, so the merge is great news, but so far it seems to fail on OS X.
Here's a bare-bones example test:
varpath=require("path"),Canvas=require("canvas");Canvas.registerFont(path.join(__dirname,"SourceSansPro-Regular.ttf"),{family: "Source Sans Pro"});
With canvas@1.6.2, Node v4.5.0 on OS X El Capitan, running that script throws the following error:
TypeError: Canvas.registerFont is not a function
at Object.<anonymous> (/canvas-test/test.js:4:8)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10)
at startup (node.js:139:18)
at node.js:974:3
Am I missing something? That appears to be the correct API, based on the updated font example.
Yeah, it isn't released yet, it's gonna be in version 2.0 which @LinusU is still working on merging stuff in for (note the top of the README.md on master)
But it looks like your fork was deleted and rebuilt, or something similar, two weeks ago, so that URL is broken now. Would it make sense to use your most recent commit on the current fork:
Well linking to the Automattic master is what throws that registerFont error, because it's the 1.x version, right? I'm not sure how to get the benefit of the font fixes while changing as little else as possible. A temporary solution might be for me to put that working commit onto GH from an old installation, any objection to that?
It shouldn't if you use the git URL - registerFont is on Automattic/node-canvas's master right now, it's just not in any NPM release. But I also just now pushed up my prefer-pango branch in case anyone else is still using it
Activity
chearon commentedon Nov 4, 2016
Yeah, it isn't released yet, it's gonna be in version 2.0 which @LinusU is still working on merging stuff in for (note the top of the README.md on master)
veltman commentedon Nov 4, 2016
Ohhh, gotcha. So we've been using the patch on your fork as a dependency:
https://github.com/nypublicradio/audiogram/blob/master/package.json#L28
But it looks like your fork was deleted and rebuilt, or something similar, two weeks ago, so that URL is broken now. Would it make sense to use your most recent commit on the current fork:
chearon@50b7c12
Or is that going to go away too?
Thanks for all your work on the font issues!
chearon commentedon Nov 4, 2016
Oh shoot, I was worried that might happen, seems like a few people were relying on my branch and I forgot to wait a while before I deleted it.
Anyways yes, since that commit is in master it is there to stay, you could also link to the Automattic master at this point
veltman commentedon Nov 4, 2016
Well linking to the Automattic master is what throws that
registerFonterror, because it's the 1.x version, right? I'm not sure how to get the benefit of the font fixes while changing as little else as possible. A temporary solution might be for me to put that working commit onto GH from an old installation, any objection to that?chearon commentedon Nov 4, 2016
It shouldn't if you use the git URL -
registerFontis on Automattic/node-canvas's master right now, it's just not in any NPM release. But I also just now pushed up myprefer-pangobranch in case anyone else is still using itveltman commentedon Nov 4, 2016
Oh, sorry, I see! I'll give that a shot. In the meantime, it looks like this commit:
https://github.com/chearon/node-canvas.git#12971f64a66b
also works, so I'll deploy that as a temporary fix and then test out the main master.
chearon commentedon Nov 4, 2016
Yep, the 2 after that are just small improvements
jleclanche commentedon Dec 25, 2016
Any word on a release? There hasn't been any since October, would love one :)
use more recent node-canvas commit