Erik van Blokland 3646055ea2 initial import
git-svn-id: http://svn.robofab.com/trunk@1 b5fa9d6c-a76f-4ffd-b3cb-f825fc41095c
2008-01-07 17:40:34 +00:00

30 lines
634 B
Python

# robofab manual
# Glyphmath howto
# Fun examples
#FLM: Fun with GlyphMath
# this example is meant to run with the RoboFab Demo Font
# as the Current Font. So, if you're doing this in FontLab
# import the Demo Font UFO first.
from robofab.world import CurrentFont
from random import random
f = CurrentFont()
condensedLight = f["a#condensed_light"]
wideLight = f["a#wide_light"]
wideBold = f["a#wide_bold"]
diff = wideLight - condensedLight
destination = f.newGlyph("a#deltaexperiment")
destination.clear()
x = wideBold + (condensedLight-wideLight)*random()
destination.appendGlyph( x)
destination.width = x.width
f.update()