root/trunk/Documentation/TypoTechnica 2005/scripts Folder/Paulus - font/interpolate in cur font.py

Revision 1, 0.7 kB (checked in by erik, 3 years ago)

initial import

  • Property svn:executable set to
Line 
1 #FLM: Interpolate in current font
2
3 # Interpolate selected glyphs in the current font
4 # Paul van der Laan, 2004/08/12
5
6 from robofab.world import SelectFont, CurrentFont
7 from robofab.interface.all.dialogs import ProgressBar
8
9 factor = 1.37
10 myFont = CurrentFont()
11 myGlyphs = myFont.selection
12
13 myMin = SelectFont('Select source font one:')
14 if myMin:
15         myMax = SelectFont('Select source font two:')
16         if myMax:
17                 bar = ProgressBar('Interpolating...', len(myGlyphs))
18                 for myChar in myGlyphs:
19                         myFont.removeGlyph(myChar)
20                         myNewglyph = myFont.newGlyph(myChar)
21                         myNewglyph.interpolate(factor, myMin[myChar], myMax[myChar])
22                         myFont[myChar].mark = 26
23                         bar.tick()
24
25                 bar.close()
26                 myFont.update()
Note: See TracBrowser for help on using the browser.