Pomax / lib-font

This library adds a new Font() object to the JavaScript toolbox, similar to new Image() for images
MIT License
734 stars 72 forks source link

Font node #62

Closed jnieberg closed 4 years ago

jnieberg commented 4 years ago

I took the liberty to refine Font.js, being able to work in both a browser as well as Node.js. FontNode.js is a new class that can be used explicitly in Node.js, which inherits the "old" Font class. Additionally, I added a window detection variable though the existing code, that decides getting/setting the variables respectively through the window (browser) or the global (node) object. I also updated the README.md with a small node example. Feel free to add questions, suggestions and/or compliments to this PR, as you wish.

Pomax commented 4 years ago

With apologies, I'm going to leave some fairly lengthy reviews comments because this is a great idea, but the implementation needs a rearchitecting to take advantage of Node, and not break the OO programming contract.

jnieberg commented 4 years ago

Due to too many new insights we decided to withdraw this PR and go back to the drawing board. New PR hopefully soon!

Pomax commented 4 years ago

No worries - but from my end, it was going in the right direction already, so I'd have been happy to see the PR changes put in as suggested, and then probably iterated (on smaller changes) for a bit until it was ready to land =)