TIL: Edit font metadata with TTX

Today I learned about a managing font metadata with a Python script. Booyah!

Posted by Jason Merino on February 17, 2016

Today I needed to change the Full Name propery of a .ttf font file I was working with. After some searching around the interwebs I found TTX, a script written in Python which converts your font file to XML so that you can edit it’s properties and then will convert it back into a font.

The setup is simple. You can install it with pip.

pip install fonttools

Then navigate to the directory where you font is and run ttx against the standard font file to generate the XML version which has a .ttx file extension.

cd path/to/font/file
ttx AwesomeFont.ttf

Open the new .ttx file in your favorite editor.

vi AwesomeFont.ttx

Edit the data you want to and then run ttx on the edited .ttx file.

ttx AwesomeFont.ttx

Which will then generate the font file anew in that same directory with the updated metadata.

Happy font updating. Enjoy!


jason merino

Jason Merino

Jason is a software engineer specializing in JavaScript and web technologies. An avid gardener, aspiring carpenter and a blessed family man.