#FLM: Remove overlap from Remote Glyph. from robofab.world import OpenFont from robofab.tools.remote import transmitGlyph, receiveGlyph, runFontLabRemote # Pick a UFO font: f = OpenFont() print "Number of contours before", len(f['A']) # call FontLab to make a new font startNewFontCode = """from robofab.world import NewFont f = NewFont() f.info.fullName = 'Temporary Font generated by RoboFab Remote'""" print runFontLabRemote(startNewFontCode) # send a glyph to FontLab, # it will be inserted in the CurrentFont. transmitGlyph(f['A']) f.removeGlyph('A') # send instructions to remove overlap for this glyph overlapCode = """from robofab.world import CurrentFont from robofab.tools.remote import transmitGlyph f = CurrentFont() f["A"].removeOverlap() f.update() transmitGlyph(f['A']) """
# robothon06 # demo of executing python in FontLab, MacOS only # this script runs in the Python IDE # it will send some python code to FontLab # FontLab will execute the python code: # it will find the current glyph and send it to our other script. from robofab.tools.remote import runFontLabRemote, receiveGlyph from robofab.world import RFont # this is what we want FontLab to do: pythonCode = """ from robofab.world import CurrentGlyph from robofab.tools.remote import transmitGlyph g = CurrentGlyph() transmitGlyph(g) """ # this the font where we'll store the glyph from FontLab destFont = RFont() result = runFontLabRemote(pythonCode) receiveGlyph(result, destFont) print destFont.keys()
# first, try a bit of python code from robofab.tools.remote import runFontLabRemote print runFontLabRemote("print 1+1")
# robothon 2009 # demo of executing python in FontLab # sent from an outside program # using AppleEvents. MacOS only. from robofab.tools.remote import runFontLabRemote pythonCode = """ from robofab.world import CurrentGlyph from robofab.tools.remote import transmitGlyph g = CurrentGlyph transmitGlyph(g) """ print runFontLabRemote(pythonCode)