When using -s (splitting files), save the xml files in a separate directory instead of in the same dir as the font file.
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@43 4cde692c-a291-49d1-8350-778aa11640f8
This commit is contained in:
parent
72f102ca1a
commit
ab15e0757e
17
tt2xml.py
17
tt2xml.py
@ -1,7 +1,7 @@
|
|||||||
#! /usr/bin/env python
|
#! /usr/bin/env python
|
||||||
|
|
||||||
"""\
|
"""\
|
||||||
usage: %s [-h] [-v] [-s] [-t <table>] TrueType-file [XML-output-file]
|
usage: %s [-hvs] [-t <table>] TrueType-file [XML-output-file]
|
||||||
Dump a TrueType font as an XML file. If the XML-output-file argument
|
Dump a TrueType font as an XML file. If the XML-output-file argument
|
||||||
is omitted, the out put file name will be constructed from the input
|
is omitted, the out put file name will be constructed from the input
|
||||||
file name, like so: *.ttf becomes *.xml. Either way, existing files
|
file name, like so: *.ttf becomes *.xml. Either way, existing files
|
||||||
@ -13,9 +13,11 @@ usage: %s [-h] [-v] [-s] [-t <table>] TrueType-file [XML-output-file]
|
|||||||
will be dumped
|
will be dumped
|
||||||
-v verbose: messages will be written to stdout about what is
|
-v verbose: messages will be written to stdout about what is
|
||||||
being done.
|
being done.
|
||||||
-s split tables: save the XML in a separate XML file per table.
|
-s split tables: save the XML in a separate XML file per table.
|
||||||
The names of these files will be constructed from the
|
The files will be saved in a directory. The name of this
|
||||||
XML-output-file name as follows: *.xml becomes *.<tag>.xml
|
directory will be constructed from the input filename (by
|
||||||
|
dropping the extension) or can be specified by the optional
|
||||||
|
XML-output-file argument.
|
||||||
-h help: print this message
|
-h help: print this message
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -46,8 +48,11 @@ for option, value in options:
|
|||||||
|
|
||||||
if len(args) == 1:
|
if len(args) == 1:
|
||||||
ttPath = args[0]
|
ttPath = args[0]
|
||||||
name, ext = os.path.splitext(ttPath)
|
path, ext = os.path.splitext(ttPath)
|
||||||
xmlPath = name + '.xml'
|
if splitTables:
|
||||||
|
xmlPath = path
|
||||||
|
else:
|
||||||
|
xmlPath = path + '.xml'
|
||||||
elif len(args) == 2:
|
elif len(args) == 2:
|
||||||
ttPath, xmlPath = args
|
ttPath, xmlPath = args
|
||||||
else:
|
else:
|
||||||
|
17
ttDump.py
17
ttDump.py
@ -1,7 +1,7 @@
|
|||||||
#! /usr/bin/env python
|
#! /usr/bin/env python
|
||||||
|
|
||||||
"""\
|
"""\
|
||||||
usage: %s [-h] [-v] [-s] [-t <table>] TrueType-file [XML-output-file]
|
usage: %s [-hvs] [-t <table>] TrueType-file [XML-output-file]
|
||||||
Dump a TrueType font as an XML file. If the XML-output-file argument
|
Dump a TrueType font as an XML file. If the XML-output-file argument
|
||||||
is omitted, the out put file name will be constructed from the input
|
is omitted, the out put file name will be constructed from the input
|
||||||
file name, like so: *.ttf becomes *.xml. Either way, existing files
|
file name, like so: *.ttf becomes *.xml. Either way, existing files
|
||||||
@ -13,9 +13,11 @@ usage: %s [-h] [-v] [-s] [-t <table>] TrueType-file [XML-output-file]
|
|||||||
will be dumped
|
will be dumped
|
||||||
-v verbose: messages will be written to stdout about what is
|
-v verbose: messages will be written to stdout about what is
|
||||||
being done.
|
being done.
|
||||||
-s split tables: save the XML in a separate XML file per table.
|
-s split tables: save the XML in a separate XML file per table.
|
||||||
The names of these files will be constructed from the
|
The files will be saved in a directory. The name of this
|
||||||
XML-output-file name as follows: *.xml becomes *.<tag>.xml
|
directory will be constructed from the input filename (by
|
||||||
|
dropping the extension) or can be specified by the optional
|
||||||
|
XML-output-file argument.
|
||||||
-h help: print this message
|
-h help: print this message
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -46,8 +48,11 @@ for option, value in options:
|
|||||||
|
|
||||||
if len(args) == 1:
|
if len(args) == 1:
|
||||||
ttPath = args[0]
|
ttPath = args[0]
|
||||||
name, ext = os.path.splitext(ttPath)
|
path, ext = os.path.splitext(ttPath)
|
||||||
xmlPath = name + '.xml'
|
if splitTables:
|
||||||
|
xmlPath = path
|
||||||
|
else:
|
||||||
|
xmlPath = path + '.xml'
|
||||||
elif len(args) == 2:
|
elif len(args) == 2:
|
||||||
ttPath, xmlPath = args
|
ttPath, xmlPath = args
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user