mirror of
https://github.com/weiweihuanghuang/Work-Sans.git
synced 2024-11-22 21:33:10 +03:00
20 lines
517 B
Python
Executable File
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) |