Debian Codegraph @

sources/fix_mono.py

raw
1 from fontTools.ttLib import TTFont
2 import os, sys
3
4 folder = sys.argv[1]
5
6 for file in os.listdir(folder):
7 if "Mono" not in file:
8 continue
9
10 font_path = os.path.join(folder, file)
11 font = TTFont(font_path)
12 font["OS/2"].xAvgCharWidth = 500
13 font["post"].isFixedPitch = 1
14 font.save(font_path, reorderTables=False)
15