summaryrefslogtreecommitdiff
path: root/misc/pylib/extractor/formats/ttx.py
diff options
context:
space:
mode:
Diffstat (limited to 'misc/pylib/extractor/formats/ttx.py')
-rwxr-xr-xmisc/pylib/extractor/formats/ttx.py28
1 files changed, 0 insertions, 28 deletions
diff --git a/misc/pylib/extractor/formats/ttx.py b/misc/pylib/extractor/formats/ttx.py
deleted file mode 100755
index fac4a98a0..000000000
--- a/misc/pylib/extractor/formats/ttx.py
+++ /dev/null
@@ -1,28 +0,0 @@
-from extractor.formats.opentype import extractOpenTypeInfo, extractOpenTypeGlyphs, extractOpenTypeKerning
-
-def isTTX(pathOrFile):
- from fontTools.ttLib import TTFont, TTLibError
- try:
- font = TTFont()
- font.importXML(pathOrFile)
- del font
- except TTLibError:
- return False
- return True
-
-def extractFontFromTTX(pathOrFile, destination, doGlyphs=True, doInfo=True, doKerning=True, customFunctions=[]):
- from fontTools.ttLib import TTFont, TTLibError
- source = TTFont()
- source.importXML(pathOrFile)
- if doInfo:
- extractOpenTypeInfo(source, destination)
- if doGlyphs:
- extractOpenTypeGlyphs(source, destination)
- if doKerning:
- kerning, groups = extractOpenTypeKerning(source, destination)
- destination.groups.update(groups)
- destination.kerning.clear()
- destination.kerning.update(kerning)
- for function in customFunctions:
- function(source, destination)
- source.close()