Ejemplo n.º 1
0
#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'])
"""
 
Ejemplo n.º 2
0
# 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()
Ejemplo n.º 3
0
# first, try a bit of python code
from robofab.tools.remote import runFontLabRemote
print runFontLabRemote("print 1+1")
Ejemplo n.º 4
0
# 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)
Ejemplo n.º 5
0
#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'])
"""