optimize

equalizeCurves(glyph, roundPos=False)

Balance handles of all contours in glyph.

from hTools3.modules.optimize import equalizeCurves
g = CurrentGlyph()
equalizeCurves(g)
g.changed()
curvesToLines(glyph)

Convert all curve segments in glyph to line segments.

from hTools3.modules.optimize import curvesToLines
g = CurrentGlyph()
curvesToLines(g)