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:
parent
8bd5dcb7e7
commit
b849ad8d8e
@ -41,13 +41,10 @@ def setFoundrySetting(key, value, dstPath):
|
|||||||
writeFoundrySettings(d, dstPath)
|
writeFoundrySettings(d, dstPath)
|
||||||
|
|
||||||
def readGlyphConstructions():
|
def readGlyphConstructions():
|
||||||
"""read GlyphConstruction.txt and turn it into a dict"""
|
"""read GlyphConstruction and turn it into a dict"""
|
||||||
dataDir=os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(robofab.__file__))), 'Data')
|
from robofab.tools.glyphConstruction import _glyphConstruction
|
||||||
glyphConstructions={}
|
data = _glyphConstruction.split("\n")
|
||||||
filePath = os.path.join(dataDir, 'GlyphConstruction.txt')
|
glyphConstructions = {}
|
||||||
f = open(filePath, 'rb')
|
|
||||||
data = f.read().replace('\r', '\n').split('\n')
|
|
||||||
f.close()
|
|
||||||
for i in data:
|
for i in data:
|
||||||
if len(i) == 0: continue
|
if len(i) == 0: continue
|
||||||
if i[0] != '#':
|
if i[0] != '#':
|
||||||
@ -166,3 +163,8 @@ def fontToUFO(src, dst, fileType=None):
|
|||||||
elif fileType == "Type 1":
|
elif fileType == "Type 1":
|
||||||
info = extractT1FontInfo(font)
|
info = extractT1FontInfo(font)
|
||||||
ufoWriter.writeInfo(info)
|
ufoWriter.writeInfo(info)
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
print readGlyphConstructions()
|
||||||
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user