root/trunk/Documentation/TypoTechnica 2005/scripts Folder/Paulus - bricks/ligatures.py

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

initial import

  • Property svn:executable set to
Line 
1 from robofab.world import CurrentGlyph, CurrentFont
2
3 myFont = CurrentFont()
4 # myGlyph = CurrentGlyph()
5
6 myDict = {"fi": ["f", "i"], "fl": ["f", "l"]}
7
8 for myLig in myDict:
9         for myBasechar in myDict[myLig]:
10                 myDest = myFont[myLig]
11                 mySource = myFont[myBasechar]
12                 myDest.appendGlyph(mySource)
13                 myWidth = mySource.width
14                 for contour in myDest.contours:
15                         contour.move((-myWidth, 0))
16        
17         myDest.leftMargin = myFont[myDict[myLig][0]].leftMargin
18         myDest.rightMargin = myFont[myDict[myLig][-1]].rightMargin
19        
20         myDest.update()
Note: See TracBrowser for help on using the browser.