Closed prewk closed 9 years ago
Ah good catch.
The behavior of this module changed recently and the docs need to be updated to reflect this. Basically to remove the node.js' canvas dependency the module requires that you pass in a WebGL context. I'll update the example to reflect this.
Excellent, thanks!
Hm, played around and couldn't get it to work with gl
(a headless WebGL lib) and from what I could gather some other libs required desktop graphics, and wouldn't work on a server. Will I be able to render server-side with your package?
Errr, sorry I typoed that. It isn't a webgl context but a canvas 2d context, as would be produced for example from node-canvas
Ah, okay. Bummer, I was primarily looking for a module not relying on external libs (node-canvas
needs non-node libs installed, different on different systems etc)
Thanks anyway!
Yeah, it is unfortunate. Text rendering is really complicated though, and there aren't easy solutions.
I have same original problem described by @prewk.
I'm confused because the source code still wants a canvas. The example code isn't passing it.
What can I edit to make this work?
Update: I looked at code some more... probably on node.js no context exists? (it's just gonna get left as null
) Isn't it blatantly false advertising to make this thing look like it works for node.js without a browser context (first sentence of readme)? Incidentally, this entire issue discussion makes a lot more sense at this point. I'll try injecting node-canvas
into this to see if it works...
Update: node-canvas
on osx is a shit-show, build fails spectacularly
Hi, The example code fails like this for me:
Which makes sense, because
defaultContext
gets set tonull
in yourindex.js
, and I don't pass in anoptions.context
so it defaults to that on index.js:23.Am I missing something?
The Readme says it works both in Node and Browserify, but the code seems to require a canvas to be passed in?