txtjs, Useuses

2014-11-21 00:00:00 +0000 by Alex R. Young


Ted Patrick sent in txtjs (GitHub: diverted247/txtjs, License: BSD), a typesetting engine. It provides font and glyph rendering that is indepenent of the OS and browser by using SVGPath on a canvas element.

The documentation has lots of examples so you can see how it handles things like character styling with multiple fonts and alignment. The project comes with a warning that says txtjs should be used for "creative applications" where the layout requirements exceed the capabilities of the DOM. I imagine it could be useful in a scenario where tight control is required for graphic design projects.

txtjs is part of CreateJS, an open source set of libraries including EaselJS and TweenJS.


Useuses (GitHub: SpoonX/useuses, License: BSD-2-Clause, npm: useuses) by Wesley Overdijk is a library for handling "soft" dependencies. Given a JavaScript file, you can express the dependencies with @uses ./my-dependency.js in a comment.

Once you've defined dependencies you can create builds with the command-line tool, like this:

useuses -i example/main.js -o example/dist/built.js -w

There's also a Node API, so you could hook it into a Grunt or Gulp. Wesley had created an earlier version that was for Grunt, but this is a rewritten, more generic version. He's written a blog post about JavaScript dependency management that describes the module in more details.