@@ -50,7 +50,7 @@ def dlig2calt(fontPath, inplace=False):
5050 for glyphName in font .getGlyphNames ():
5151 if font ['hmtx' ][glyphName ][0 ] > unitWidth :
5252
53- decomposeAndRemoveOverlap (font , glyphName )
53+ # decomposeAndRemoveOverlap(font, glyphName)
5454
5555 # set width to space (e.g. 600), then offset left side to be negative
5656 oldWidth = font ['hmtx' ][glyphName ][0 ]
@@ -60,15 +60,17 @@ def dlig2calt(fontPath, inplace=False):
6060 font ['hmtx' ].__setitem__ (glyphName , (unitWidth , newLSB ))
6161
6262 # Adjust coordinates in glyf table
63- coords = font ['glyf' ][glyphName ].coordinates
64- phantoms = font ['glyf' ].getPhantomPoints (glyphName , font )
63+ coords = font ['glyf' ]._getCoordinatesAndControls (glyphName , font ['hmtx' ].metrics )[0 ]
64+ phantoms = font ['glyf' ]._getPhantomPoints (glyphName , font ['hmtx' ].metrics )
65+
66+ # take off last four items of coords to allow adjusted phantoms to be handled separately, then combined
67+ coords = coords [:len (coords )- 4 ]
6568
6669 adjustedCoords = [(x - widthDiff , y ) for x , y in coords ]
6770 adjustedPhantoms = [(0 ,0 ), (600 ,0 ), phantoms [- 2 ], phantoms [- 1 ]]
6871
6972 newCoords = adjustedCoords + adjustedPhantoms
70- # print(glyphName, newCoords, font) # DEBUGGING
71- font ['glyf' ].setCoordinates (glyphName , newCoords , font )
73+ font ['glyf' ]._setCoordinates (glyphName , newCoords , font ['hmtx' ].metrics )
7274
7375
7476 # add new feature code, using calt rather than dlig
0 commit comments