With ufoJS you can load, manipulate and save font data in JavaScript. A UFO: Unified Font Object is a directory based file format representing font data in a human readable way. UFO is already supported by all major font development tools. ufoJS enables browser based font development tools that blend nicely into professional workflows.
ufoJS is tested with nodeJS and current Firefox and Chrome. You can run the unit tests with other browsers and see where it breaks and where it works.
The GlyphSet and its dependencies are implemented and tested. This means
you now have control over everything in the glyphs
directory of your
UFOv2/v3 and the UFOv3 layers (which is data wise the same as the
glyphs
directory). However, this is not stable yet. We will definitely
find some bugs when using it.
Not in the box yet are the APIs for everything above the glyph layer level. This is the next big task.
- Run the Testsuite
- Sample application: Glif Renderer
The starting point for ufoJS is porting RoboFab to JavaScript. Once this is done to a satisfactory point, we can start with optimizing the APIs and inner workings for new challenges. However, the first goal is to become useful and fully unit tested.
There are already significant differences to the RoboFab legacy:
-
ufoJS provides both a synchronous and an asynchronous API.
- The asynchronous API is particularly useful for User Interfaces or fast NodeJS based servers. JavaScript developers know this concept already.
- The synchronous API is useful for adhoc-scripting, simple command line programms or webworkers. It is less complex to write synchronous scripts.
ObtainJS is used to implement the asynchronous and synchronous API side by side. Go to the OtainJS Repository to learn how to use APIs implemented with it or how to implement APIs with ObtainJS.
-
ufoJS does file system abstraction based on a dependency injection pattern. You can write your own persistence module and just use it. See the I/O modules for the yet early state of the Interface.
There is no good Documentation or guide yet. You are welcome to start that and I would gladly support you. In the meantime your options are:
- Read the source, Luke and read the unit tests, too. Also, there is a mini sample App, the glif-renderer
- See how things are done with RoboFab and try to transfer you knowledge.
keep this under your pillow ;-)
ufoJS is based on porting the Python code of FontTools and RoboFab to JavaScript.
The files of the Python sources are referenced in the headers of the files of this project.
FontTools Authors: Just van Rossum, Behdad Esfahbod
RoboFab Authors: Erik van Blokland, Tal Leming, Just van Rossum
The Project itself uses an Modules/AsynchronousDefinition-Loader defined by commonJs and currently provided by RequireJS and RequireJS for nodeJs Author: James Burke
The Tests are driven by (an old version of) the D.O.H: Dojo Objective Harness Authors: Alex Russell, Pete Higgins, Dustin Machi, Jared Jurkiewicz
The implementation of the Synchronous/Asynchronous APIs is made with ObtainJS Author: Lasse Fister
© [The ufoJS authors](./AUTHORS) ![GPLv3](https://www.gnu.org/graphics/gplv3-127x51.png)