Node.js support
add a util function to load an font file on the server-side
can it support nodejs now ?
Thanks for pinging me. This was long overdue.
There's some preliminary node support now in the new node-version branch. See this example: test.js. You'll need to cd into the js directory or otherwise it cannot find the font files.
For now, the node js support is pretty basic. I haven't looked into creating an actual npm package for example.
I hope you find it useful. Suggestions and/or PR's are always welcome ;-)
Thanks, I thank it's usefull for me.
When I cd into test/ and run node test, it catch "Unable to parse font!" error. What's the problem.
You should be cd'ing into js not test. What platform are you on? I have only tested on OSX. Also, can you give me a stracktrace?
I try cd into js and node test, it also catch that error, running on node 0.10.13 win7 64.
I have try it on OSX, it runs fine. @remcoder can your make it support for windows ?
@remcoder , i have found the problem that cause the error, in windows bdf file is in windows line ending, save bdf file with unix line ending, it runs file.
Thx for reporting back. I appreciate it ;-)
FWIW adding node support was stupid easy - nice job @remcoder. It was just a matter of changing the loadFont function to use fs.readFile() and then exporting the Pxxl function.
For some reason, the small font doesn't work for me but the others do. Nice :)