adm-ntuh-net/forteo/split_ttc_font_to_ttf.py
2024-12-12 10:19:16 +08:00

16 lines
No EOL
402 B
Python

"""Convert TTC font to TTF using fontforge with python extension.
**Warning** The scripts saves splitted fonts in the current working directory.
Usage:
split_ttc_font_to_ttf.py Droid.ttc
"""
import sys
import fontforge
fonts = fontforge.fontsInFile(sys.argv[1])
for fontName in fonts:
font = fontforge.open('%s(%s)'%(sys.argv[1], fontName))
font.generate('%s.ttf'%fontName)
font.close()