How to convert an OpenType font (.otf) to TrueType (.ttf)

Posted on 2010-10-17

I wanted to show the new STIX fonts on FileFormat.Info, but they are only available in a flavor of OpenType that doesn't load in Java. This is how to convert them to TrueType. It may lose some of the more advanced typographic features, but I am only showing a single character at a time, so it does not really matter for my purposes.

tl;dr version: use FontForge. Open the .otf file and then File->Generate, and select TrueType

Automated/scripted version:

Install the required software:

sudo apt-get install fontforge python-fontforge

Create a tiny python file:

#!/usr/bin/python
import fontforge
font = fontforge.open("STIXGeneral.otf")
font.generate("STIXGeneral.ttf")

Pretty simple. I wrote a otf2ttf.py script for converting a directory full of fonts all at once.

Tags: ttf otf TrueType OpenType FontForge fonts