Don't read GlyphConstructions.txt but rather robofab.tools.glyphConstruction.

git-svn-id: http://svn.robofab.com/trunk@65 b5fa9d6c-a76f-4ffd-b3cb-f825fc41095c
This commit is contained in:
Erik van Blokland 2008-03-11 08:57:37 +00:00
parent 8bd5dcb7e7
commit b849ad8d8e

View File

@ -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')
"""read GlyphConstruction and turn it into a dict"""
from robofab.tools.glyphConstruction import _glyphConstruction
data = _glyphConstruction.split("\n")
glyphConstructions = {}
filePath = os.path.join(dataDir, 'GlyphConstruction.txt')
f = open(filePath, 'rb')
data = f.read().replace('\r', '\n').split('\n')
f.close()
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()