Factor Language Blog

Unicode font rendering in the Factor UI on Mac OS X

Wednesday, January 21, 2009

For the last month and a half, I’ve been working hard on a big top-to-bottom overhaul of the UI. The developer tools are getting a big facelift, and so is the gadget substrate and backend rendering code. When it is closer to completion, I will blog more about the new features and post a screencast showing off the new capabilities.

For now, here is a screenshot demonstrating just one of the many new features and improvements: Unicode font rendering on Mac OS X, with a cross-platform Factor API on top, and Apple’s Core Text API under the covers:

Notice the Georgian text in the title bar. Non-ASCII window titles have already worked for a long time.

Throwing together bindings for Core Text and Core Graphics was pretty easy using Factor’s FFI. Our destructors feature really helps bridge the gap between Factor’s GC and C’s manual memory management.

On Windows and X11, I’m still using a portable FreeType backend for ASCII-only text, but I plan on replacing that with Microsoft’s UniScribe (on Windows) and Pango (on X11). This will free Factor’s UI from external dependencies other than those shipped with the operating system; having to lug the FreeType library around was annoying for deployment.

Support for input methods is next, and together with Daniel Ehrenberg’s excellent pure-Factor Unicode library, this will give Factor excellent support for international applications that works identically across platforms. I don’t think any of the other “new” languages, which have had a similar amount of developer effort and time put into it as Factor, come close in this respect.