[subset] when no --output-file=, use INPUT_FILE.subset.{extension}

We should probably use cliTools.makeOutputFileName here for consistency with ttx,
but I know some prefer the approach taken by pyftsubset so I don't want force this.

Howver, I find it a bit annoying that when one is too lazy (like me) to specify
the --output-file=, the subsetter outputs a file ending with an invalid ".subset" extension, which Finder or Windows Explorer don't recongize as a font, and so one has to rename it anyway.

This makes the '.subset' string is inserted between the file name and its original extension (if any).
This commit is contained in:
Cosimo Lupo 2017-01-13 12:50:46 +00:00
parent f168c0ccb5
commit c63fea0f8f
No known key found for this signature in database
GPG Key ID: B61AAAD0B53A6419

View File

@ -2866,6 +2866,7 @@ def usage():
@timer("make one with everything (TOTAL TIME)")
def main(args=None):
from os.path import splitext
from fontTools import configLogger
if args is None:
@ -2902,7 +2903,8 @@ def main(args=None):
args = args[1:]
subsetter = Subsetter(options=options)
outfile = fontfile + '.subset'
basename, extension = splitext(fontfile)
outfile = basename + '.subset' + extension
glyphs = []
gids = []
unicodes = []