Skip to content

Commit d426b37

Browse files
committed
[addSVGtable.py] Remove fontTools workaround
1 parent 3b14993 commit d426b37

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

addSVGtable.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -102,20 +102,8 @@ def processFontFile(fontFilePath, svgFilePathsList):
102102
svgTable.compressed = False # GZIP the SVG docs
103103
svgTable.docList = svgDocsList
104104
font[TABLE_TAG] = svgTable
105-
106-
# FontTools can't overwrite a font on save,
107-
# so save to a hidden file, and then rename it
108-
# https://github.com/behdad/fonttools/issues/302
109-
folderPath, fontFileName = os.path.split(fontFilePath)
110-
fileNameNoExtension, fileExtension = os.path.splitext(fontFileName)
111-
newFontFilePath = os.path.join(folderPath, "{}{}{}".format(
112-
'.', fileNameNoExtension, fileExtension))
113-
114-
font.save(newFontFilePath)
105+
font.save(fontFilePath)
115106
font.close()
116-
# On Windows a file can't be renamed to a file that already exists
117-
os.remove(fontFilePath)
118-
os.rename(newFontFilePath, fontFilePath)
119107

120108
print(
121109
"SVG table successfully added to {}".format(fontFilePath),

0 commit comments

Comments
 (0)