TIL: Edit font metadata with TTX

October 02, 2016Pythonfonts

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!

The author, Jason Merino, with sun glasses and a hat

Jason Merino 💻 🚀

Software engineer, TypeScript enthusiast, avid gardener, all around family man, Franciscan at heart, celiac, aphantasiac. I enjoy nature and a good technical manual.

Follow me on Twitter and checkout my code on Github!