File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010from argparse import ArgumentParser
1111import pathops
1212
13- def decomposeAndRemoveOverlap (font , glyphName ):
14-
15- glyfTable = font ["glyf" ]
16- glyphSet = font .getGlyphSet ()
17-
18- # record TTGlyph outlines without components
19- dcPen = DecomposingRecordingPen (glyphSet )
20- glyphSet [glyphName ].draw (dcPen )
21-
22- # replay recording onto a skia-pathops Path
23- path = pathops .Path ()
24- pathPen = path .getPen ()
25- dcPen .replay (pathPen )
26-
27- # remove overlaps
28- path .simplify ()
29-
30- # create new TTGlyph from Path
31- ttPen = TTGlyphPen (None )
32- path .draw (ttPen )
33- glyfTable [glyphName ] = ttPen .glyph ()
34-
3513
3614# codeLigs = {} # probably not needed
3715
@@ -50,8 +28,6 @@ def dlig2calt(fontPath, inplace=False):
5028 for glyphName in font .getGlyphNames ():
5129 if font ['hmtx' ][glyphName ][0 ] > unitWidth :
5230
53- # decomposeAndRemoveOverlap(font, glyphName)
54-
5531 # set width to space (e.g. 600), then offset left side to be negative
5632 oldWidth = font ['hmtx' ][glyphName ][0 ]
5733 oldLSB = font ['hmtx' ][glyphName ][1 ]
You can’t perform that action at this time.
0 commit comments