from robofab.glifLib import writeGlyphToString from robofab.world import CurrentFont, CurrentGlyph from robofab.interface.all.dialogs import PutFile from robofab.tools.glyphNameSchemes import glyphNameToShortFileName import os f = CurrentFont() g = CurrentGlyph() if g is not None: todo = [g.name] else: todo = f.selection for c in todo: g = f[c] result = True data = writeGlyphToString(g.name, g, g.drawPoints) filename = glyphNameToShortFileName(g.name, None) file = PutFile("Save this glif as:") if file is not None: path = os.path.join(os.path.dirname(file), filename) print "saving to", path f = open(path, "w") f.write(data) f.close() print 'done'
def PlistFactory(glyph, font): return writeGlyphToString(glyph.name, glyph, glyph.drawPoints)
""" from robofab.glifLib import writeGlyphToString from robofab.world import CurrentFont, CurrentGlyph from robofab.interface.all.dialogs import PutFile from robofab.tools.glyphNameSchemes import glyphNameToShortFileName import os f = CurrentFont() g = CurrentGlyph() if g is not None: todo = [g.name] else: todo = f.selection for c in todo: g = f[c] result = True data = writeGlyphToString(g.name, g, g.drawPoints) filename = glyphNameToShortFileName(g.name, None) file = PutFile("Save this glif as:") if file is not None: path = os.path.join(os.path.dirname(file), filename) print "saving to", path f = open(path, "w") f.write(data) f.close() print 'done'