Introducing TruFont
For years, FontForge has been the dominant free-software application for editing and building font files, but it has always been a difficult codebase to work with. At Libre Graphics Meeting 2016 in London, Adrien Tétar presented his work on a promising replacement called TruFont. The new application builds on top of several popular open-source libraries that are widely used by font engineers and even by proprietary font editors. That gives TruFont a head start, and it may mean that the project can count on a more diverse assortment of contributors as time goes by.
Tétar joined the FontForge team in 2014, he said, with an interest in making fonts for math and science. It was widely acknowledged that FontForge was hard to maintain (at 600,000 lines of C) and had an awkward user interface but, still, no one was working on an open-source replacement. For reference, he pointed the audience to an October 2015 discussion on the difficulty of adding features to FontForge.
In response to such frustrations, Dave Crossland suggested that he look into building a new UI for FontForge on top of the application's Python interface. Tétar then began looking into the Unified Font Object (UFO) file format. UFO was first developed as an alternative to the proprietary FontLab file format, and it was developed in concert with another proprietary font editor, RoboFont. But RoboFont came with a large open-source Python library (RoboFab) that defined primitives for manipulating glyphs, fonts, contours, and other common components.
Another proprietary application, Glyphs, had also begun using RoboFab and UFO, and in recent years both Glyphs and RoboFont had developed a healthy ecosystem of Python utilities, in a sense "closing the gap between scripting and application development." In particular, Tétar said, Tal Leming has released a lot of significant plumbing as open-source software. That includes the Defcon library, which provides Python primitives for most of the plumbing one needs to build a font editor: a factory system, abstract classes for glyph representations, object caching, tools and views that can refresh automatically on changes to the data, and so on. So, rather than building on top of FontForge, Tétar decided to try and make a free editor out of all of the disparate free components. He started work in April 2015, and made the first release (dubbed TruFont) that October.
TruFont
TruFont includes a set a of Qt bindings on top of Defcon and a
basic font-editor environment. Out of the box, it allows users to
open UFO files and manipulate Bézier contours, adjust spacing and
metrics, and other such simple tasks. Moving forward, though, Tétar
expects most of the new functionality to be implemented in Python
extensions. Thus, at present, there are only basic selection and
drawing tools. He demonstrated how the tool classes can be extended
to easily add more complex functionality. Likewise, the basic "glyph
view" shows only the outline of the current character, but he showed
an extension that adds visualizations of longer strings of adjacent
characters—something that font developers often use to provide
context for the glyph they are working on.
The latest release is TruFont 0.4, which was tagged just before LGM. Tétar showed some download statistics for the prior releases; on average, Mac OS X has close to 60% of the downloads, followed by Windows at 30% and Linux with 10%. His target is for TruFont to correctly display and edit every part of a UFO font, he said, and leave the "magic" up to the extension writers. That allows TruFont to remain as lean as possible. And by using Qt, unlike FontForge, TruFont uses the native UI widget set on every platform.
But the extension-centric approach also means that new contributors will have to gain a fairly deep understanding of the APIs offered by RoboFab, Defcon, and the other libraries (such as FontTools, which provides a range of font-transformation functions, MutatorMath, which provides interpolation functions, and booleanOperations, which provides functions for working with Bézier contours). In general, Tétar told the audience, Defcon contains the "low-level" functions and Robofab the "high-level" abstractions but, ultimately, every part of the editor and every part of a font is accessible for manipulation with a Python extension.
He noted that both Glyphs and RoboFont were started by type designers who got roped into being software developers by the desire to have better tools. And non-developers, as a rule, seem to like spreading the maintenance burden around. His hope is that TruFont will allow a lot of contributors to each "own a piece" of the editor as their own extension, and that collectively the entire community can have a better and more modular font editor.
There were a few questions from the audience about just how far the "extension-driven" development model would go. Surely, one audience member asked, there are basic expectations that users will expect to be present in the default download. Tétar conceded that such expectations were valid, and said that he may take a "batteries included" approach in the end, but that, right now, he is not sure which features would define a base of functionality, so he regards expanding the core feature set as a "maybe."
In addition to his talk, Tétar led a workshop session introducing participants to TruFont's internals and to scripting new tools. The room was packed, and the workshop well-received.
FontForge
In an informative side note, FontForge maintainer Frank Trampe presented a lightning talk at LGM, during which he reassured users that FontForge was not going away any time soon. The talk, he said, was a "rebuttal" to the LGM 2015 talk in which Dave Crossland announced he was withdrawing from FontForge development.
Trampe was quick to admit FontForge's shortcomings as a codebase (which he and the other current members of the development team inherited, but did not create), and noted that TruFont takes the "correct approach" to designing a font editor—as well as not implementing its own, internal widget toolkit. But it will still be quite a long time before all of FontForge's capabilities can be re-implemented for TruFont; in the meantime, users need a working free-software application to design fonts. In addition, FontForge is the build tool for many open-source fonts used by the free-software community and shipping in Linux distributions.
Thus, Trampe said, it is an important tool, and he is committed to making it work well. In the past three years, he pointed out, the team has worked to stamp out the stability problems that plagued earlier releases, and the development process has been improved by migrating to GitHub and using continuous-integration tools. FontForge's big problems, Trampe said, are for developers. For users, it is as stable as a font editor can be and offers a complete tool set for working with glyphs, font features, tables, and "every font file format" available.
He also said that he continues to get lots of feature requests—including, Trampe noted, quite a few from Crossland—which indicates the community is still interested. The last release, he said, received more than 10,000 downloads. TruFont may be the way forward, he said, but until it is done, he and others will continue to work on FontForge.
FontForge is not unique in having technical debt; many open-source projects accrue baggage over the years and eventually a rewrite or a replacement is warranted. TruFont is, by design, a modular application that will likely be far more maintainable than FontForge. But it has not attracted attention from open-source developers simply because it has a modern architecture. The more intriguing aspect of the project is how much it builds on top of other frequently used font libraries—including those popular with proprietary tool developers. That may make it a more appealing target for casual developers and font designers who occasionally write scripts, which is an audience well worth targeting.
[The author would like to thank Libre Graphics Meeting for
travel assistance to London for LGM 2016.]
Index entries for this article | |
---|---|
Conference | Libre Graphics Meeting/2016 |
Posted Apr 29, 2016 5:48 UTC (Fri)
by liam (guest, #84133)
[Link] (8 responses)
https://lists.fedoraproject.org/archives/list/desktop@lis...
Posted Apr 29, 2016 7:52 UTC (Fri)
by halla (subscriber, #14185)
[Link] (5 responses)
Posted Apr 29, 2016 21:59 UTC (Fri)
by lsl (subscriber, #86508)
[Link] (4 responses)
Losing the ability to cross compile for Windows is pretty awful if you want to hand out Windows binaries. Especially when thinking of the awesome collection of MinGW-built open source libraries available in Fedora in nicely pre-packaged form.
Posted Apr 29, 2016 22:00 UTC (Fri)
by Cyberax (✭ supporter ✭, #52523)
[Link]
Posted Apr 30, 2016 6:58 UTC (Sat)
by halla (subscriber, #14185)
[Link] (2 responses)
In any case, making binaries on windows is perfectly possible, been there, done that. These days I use MXE to cross-compile almost all dependencies for Krita, and then cross-compile Krita, too, but that's only because one or two libraries we depend on cannot be built with msvc.
(And why did we start doing our Windows builds on Windows? Well, mostly to force myself to use Windows now and then: if you want to publish software for a platform, you'd better know how to use that platform.)
Posted Apr 30, 2016 13:17 UTC (Sat)
by lsl (subscriber, #86508)
[Link] (1 responses)
It's all in the link given by liam (to which you replied, so I thought you've seen that). A more specific account of the problems involved can be gained from the FESCo meeting logs[2], starting at 18:13:07.
The inability to cross-compile python from source using a Free Software toolchain means that the next Fedora release won't come with an official Live Media Creator for Windows. Incorporating such huge patch sets with no chance of upstream acceptance is obviously not acceptable to Fedora.
[1] https://github.com/Alexpux/MINGW-packages/tree/master/min...
Posted May 23, 2016 13:55 UTC (Mon)
by mathstuf (subscriber, #69389)
[Link]
Even worse, the version of MSVC is dictated too. Importing into newer versions fail spectacularly. For example, Python2 is either MSVC 2008 or roll your own (there are CMake buildsystems out there to be able to build for other compilers, but no one has made them on feature parity with upstream AFAIK).
Posted Apr 29, 2016 15:34 UTC (Fri)
by davelab6 (guest, #86237)
[Link] (1 responses)
Posted Apr 30, 2016 2:49 UTC (Sat)
by liam (guest, #84133)
[Link]
Posted May 11, 2016 6:42 UTC (Wed)
by monkeyiq (guest, #55153)
[Link]
Yes, FontForge has it's own an abstraction layer over X for the UI. These days one would probably use Qt, GTK, Web 2.0-tool-of-choice or whatever.
The update I performed back in 2012 to use cairo to fill when glyph rendering is just one step in the direction of modernization. Using cairo for the main glyph view allows the menu, toolbar, etc to be replaced by ones from a standard widget set while retaining the existing rendering for the editor itself. Incremental changes to move to a simpler code base that is more easily changed.
Using a model-delegate system would help have views updated by the model automatically. Using visitor patterns would allow the code running collections to be updated. As with any project that's been around for a while, there is a reasonable list of things that could be updated. Though I'm not sure there's enough things that would be nice to update to merit starting over.
Introducing TruFont
Regarding Qt and Python, I've Read™ that combination can be difficult to wrangle, especially, but not exclusively, on Windows. Has this been encountered?
Introducing TruFont
Introducing TruFont
Introducing TruFont
Introducing TruFont
Introducing TruFont
[2] https://meetbot.fedoraproject.org/fedora-meeting/2016-04-...
Introducing TruFont
Introducing TruFont
Introducing TruFont
What I was expecting (perhaps wrongly but nevertheless) was that the font manipulation functions would be disentangled from the ad-hoc widget toolkit and turned into well factored libraries. This would then make it much easier to move it to another toolkit (which I thought was the long-term goal) and allow the font libraries to be developed by the community separately.
However, that this, or whatever the goal you had in mind, wasn't something that could be accomplished given the resources doesn't imply, to me, that MORE resources wouldn't have solved the problem (even if part of the problem includes a fork).
Of course, the amount of work that might've required might be better used to just rewrite the whole damn thing:)
FontForge codebase