| 1 | #Needs: fonts/DirectionTest.sfd |
| 2 | |
| 3 | import sys, fontforge |
| 4 | |
| 5 | font=fontforge.open(sys.argv[1]) |
| 6 | font.selection.all() |
| 7 | font.selection.select(("less",),"K") |
| 8 | |
| 9 | dir=True |
| 10 | for g in font.selection.byGlyphs : |
| 11 | c = g.foreground[0] |
| 12 | if dir != c.isClockwise(): |
| 13 | raise ValueError("Wrong direction") |
| 14 | dir = not dir |
| 15 | |
| 16 | c = font["K"].foreground[0] |
| 17 | if c.isClockwise()!=-1: |
| 18 | raise ValueError("Found a direction") |