From b849ad8d8e76d2139777dc09b10f656a67614648 Mon Sep 17 00:00:00 2001 From: Erik van Blokland Date: Tue, 11 Mar 2008 08:57:37 +0000 Subject: [PATCH] Don't read GlyphConstructions.txt but rather robofab.tools.glyphConstruction. git-svn-id: http://svn.robofab.com/trunk@65 b5fa9d6c-a76f-4ffd-b3cb-f825fc41095c --- robofab/Lib/robofab/tools/toolsAll.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/robofab/Lib/robofab/tools/toolsAll.py b/robofab/Lib/robofab/tools/toolsAll.py index 0cc0cfdf5..98292102f 100755 --- a/robofab/Lib/robofab/tools/toolsAll.py +++ b/robofab/Lib/robofab/tools/toolsAll.py @@ -41,13 +41,10 @@ def setFoundrySetting(key, value, dstPath): writeFoundrySettings(d, dstPath) def readGlyphConstructions(): - """read GlyphConstruction.txt and turn it into a dict""" - dataDir=os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(robofab.__file__))), 'Data') - glyphConstructions={} - filePath = os.path.join(dataDir, 'GlyphConstruction.txt') - f = open(filePath, 'rb') - data = f.read().replace('\r', '\n').split('\n') - f.close() + """read GlyphConstruction and turn it into a dict""" + from robofab.tools.glyphConstruction import _glyphConstruction + data = _glyphConstruction.split("\n") + glyphConstructions = {} for i in data: if len(i) == 0: continue if i[0] != '#': @@ -166,3 +163,8 @@ def fontToUFO(src, dst, fileType=None): elif fileType == "Type 1": info = extractT1FontInfo(font) ufoWriter.writeInfo(info) + +if __name__ == "__main__": + print readGlyphConstructions() + + \ No newline at end of file