Sfont, DrRacket as a font development environment

Presenting Sfont, a project of library written in Racket to play with fonts.

This summer I worked on a Racket project for working with UFOs fonts. The UFO format was choosed only because is easy to parse and write, and accepted by modern font editors.

It is a personal project and I don’t pretend to produce a real production quality font tool. My personal goals were: 1. learning how to program (and trying to apply what I’ve learned), 2. make some tools to manipulate fonts (like interpolating, etc.), 3. to test some idea.

The ideas in point 3 above were: Given the ability of drRacket to print graphics in the REPL can we use it to play with fonts and programming in a more interactive environment? Can this approach be useful in teaching about parametric type design and programming?

To give just an example (see this video), we can call a function that interpolate two fonts and we get the results in the REPL as a graphical representation of a font. In this way, I think, the difficulty of manipulating shapes programmatically is partially eliminated and we are encouraged to try and make experiments, to use a functional (as in functional programming) style, etc. (I know that, from my example, this does not look too different from calling a python script inside a font editor application, but I think it makes the interaction simpler.)

I’m still changing my program, trying to find bugs, studying how to extend it, but it can be used and tested (although I didn’t make any effort to make it installable with Planet, since I think is still only a toy). In the future, one can imagine to extend it with macros (I’ve already written some macros for writing fonts, glyphs, shapes) or building a small ‘domain specific language for type design’ (simpler than Metafont), etc.

I’m aware of my (big) limitations as a programmer, however, even if the code is not so good the ideas behind it can still be valid.

Daniele

comments powered by Disqus