Creating Type1 Fonts Directly From Metafont Sources
Posted by matijs 10/07/2005 at 12h47
I take a great interest in type design. I'm not sure when it started, but no doubt it has something to do with the following: A long time ago, I invented a writing system for the language of my imaginary country. Since then, I've created several fonts for this writing system. Since I'm only an amateur, I can't afford to buy any of the professional tools for font making, so I have had to resort to free tools (for varying definitions of free).
To me, by far the most interesting tool is METAFONT: Each glyph is built up using equations for its constituent points. By varying certain parameters in those equations, different variations of the same font can be produced. Through the use of routines, the shape of bulbs and serifs is defined in a single place, then used wherever it is appropriate. For a lover of mathematics, it is truly a beautiful system.
There is one problem with this: METAFONT is unable to produce output in any of the current standards of outline fonts that digital type comes in these days. In fact, it is unable to produce outlines at all.
Not surprising, then, converting METAFONT fonts to outlines is a long standing problem, for which no good free solution exists.
Here is the solution I'm working on: Since I'm lazy, I'm using existing (Free) programs as much as I can. First, I let the METAFONT derivative MetaPost create a PostScript representation of each glyph (one file per glyph) from the METAFONT sources. This representation uses stroked splines, so it's not yet in the form of an outline. Then, I import those into Fontforge to do the conversion to outlines, and to assemble them into a font. All this is done automatically using a perl script to glue the pieces together.
So, the script is basically ready and working (it's a bit of a hack job at the moment). I also have a script (a marginally modified version of t1diff) in place to compare the Type3 version (made with mf2pt3) and the Type1 version, to check Fontforge's handiwork. Currently, there are some errors in the conversion, but I'm debugging Fontforge to fix those (patches will follow soon). After that, I will have to put some more effort in getting such details as kerning and hinting right.