[TxMt] Re: Fixing Consolas's line-height

Matt Bauman mbauman.lists at gmail.com
Wed Mar 11 21:22:31 UTC 2009


On Sun, Mar 8, 2009 at 4:52 PM, Gerd Knops <gerti-textmate at bitart.com> wrote:
>
> What software did you use to edit that font?

After stumbling through a few random search pages, I discovered that
Apple has a suite of command line font editing tools.  Well, the tools
themselves don't do the editing; rather they extract the truetype data
into plain text (xml) tables that you can edit and then 'fuse' back
into the font.

Grab the tools here: http://developer.apple.com/FONTS/OSXTools.html

It installs the tools into /usr/bin and the documentation into
/Developer/Documentation/FontTools.

I did all this with an uninstalled font outside of the */Library/Fonts
directory.  OS X is much more robust with font management, but a
corrupt font can still really mess stuff up.  So continue at your own
risk...

Fire up Terminal, and navigate to the folder where you moved the
Consolas*.ttf fonts.  Now, you want to dump (-A d) the 'hhea' table
(-t) into an editable xml file:

ftxdumperfuser -t hhea -A d Consolas.ttf

This creates an xml file in that directory titled Consolas.hhea.xml.
Now you can edit the table parameters.  And then fuse (-A f) it back
into the font:

ftxdumperfuser -t hhea -A f Consolas.ttf

Repeat for each member of the family, and you're done!

It's a pretty cool suite.  Emboldened by my success, I decided to
modify a few glyphs that had been bugging me.  I had previously tried
to edit the TTF using the free FontForge... but never had any success
recompiling it back into a complete proper font -- it always failed
Font Book's validation and often would display gibberish.  With the
'glyf' table, you can edit the raw hex that describes the contours of
each glyph.  So, I edited the glyphs I wanted in FontForge, and
exported the TTF.  The font file didn't work as a whole, but it still
contained all the proper glyf information.  I dumped the glyph info,
grabbed the one I wanted, subbed it into the dump from the original,
and fused it back together.   And it worked!  Now I have a proper
baseline, and a Monaco style 'l' without the lower left serif (and the
'i,' too, for consistency).

Again, probably not kosher... so be careful how you end up using the font.
Matt



More information about the textmate mailing list