refactored slightly, preparing for miving most of this code to fontTools.ttx.py

git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@345 4cde692c-a291-49d1-8350-778aa11640f8
This commit is contained in:
jvr 2002-09-12 17:22:35 +00:00
parent 1a53beb7b4
commit b8f50a539c

View File

@ -127,7 +127,7 @@ class Options:
sys.exit(2) sys.exit(2)
def ttList(input, extension, options): def ttList(input, output, options):
ttf = TTFont(input) ttf = TTFont(input)
reader = ttf.reader reader = ttf.reader
tags = reader.keys() tags = reader.keys()
@ -144,8 +144,7 @@ def ttList(input, extension, options):
ttf.close() ttf.close()
def ttDump(input, extension, options): def ttDump(input, output, options):
output = makeOutputFileName(input, options.outputDir, extension)
print 'Dumping "%s" to "%s"...' % (input, output) print 'Dumping "%s" to "%s"...' % (input, output)
ttf = TTFont(input, 0, verbose=options.verbose) ttf = TTFont(input, 0, verbose=options.verbose)
ttf.saveXML(output, ttf.saveXML(output,
@ -156,8 +155,7 @@ def ttDump(input, extension, options):
ttf.close() ttf.close()
def ttCompile(input, extension, options): def ttCompile(input, output, options):
output = makeOutputFileName(input, options.outputDir, extension)
print 'Compiling "%s" to "%s"...' % (input, output) print 'Compiling "%s" to "%s"...' % (input, output)
ttf = TTFont(options.mergeFile, ttf = TTFont(options.mergeFile,
recalcBBoxes=options.recalcBBoxes, recalcBBoxes=options.recalcBBoxes,
@ -219,7 +217,8 @@ def main(args):
print 'Unknown file type: "%s"' % input print 'Unknown file type: "%s"' % input
continue continue
action(input, extension, options) output = makeOutputFileName(input, options.outputDir, extension)
action(input, output, options)
def waitForKeyPress(): def waitForKeyPress():