Work-Sans/sources/tools/NAMEpatch.py
weiweihuanghuang 38e1e73eee - Update source files
- Added old source file
- Updated name patch
2018-11-08 12:34:35 +11:00

20 lines
517 B
Python
Executable File

import os
import sys
from fontTools.ttLib import TTFont
from fontTools.ttx import makeOutputFileName
inputTTF = sys.argv[1]
# open the source file and read it
font = TTFont(inputTTF)
extension = os.path.splitext(inputTTF)[1]
# Remove space in nameID 6
if 'name' in font:
name = font['name']
for i, eachName in enumerate(name.names):
if eachName.nameID == 6:
eachName.string = eachName.string.replace(' ', '')
outputTTF = makeOutputFileName(inputTTF, '', extension)
font.save(outputTTF)