- GitHub - fonttools/fonttools: A library to manipulate font files from Python.
- GitHub - googlei18n/cu2qu: Cubic-to-quadratic bezier curve conversion
を使うと、OpenTypeからTrueTypeを作ることができる。sfntの構造をいただきつつ、CFFの中のType 2 Charstringの輪郭の向きを反転してglyf
テーブルにして突っ込み直す感じだ。ちゃんとpost
テーブルも作成してくれる。
git clone https://github.com/fonttools/fonttools.git git clone https://github.com/googlei18n/cu2qu.git
してから以下でOpenTypeからTrueTypeを作れる。
cd fonttools/Snippets python -B otf2ttf.py your_input_font.otf
ただ、欠点としてhead.unitsPerEm
とかはそのままなので、2の冪とはならず、1024や2048のボディ幅にならないことには注意。