[qu2cu] Adjust stats to match cu2qu

This commit is contained in:
Behdad Esfahbod 2023-02-22 09:18:49 -07:00
parent 5125e9e095
commit e72d195583
2 changed files with 3 additions and 3 deletions

View File

@ -52,7 +52,7 @@ class Qu2CuPen(ContourFilterPen):
curves = quadratic_to_curves(q, self.max_err, all_cubic=self.all_cubic)
if self.stats is not None:
for curve in curves:
n = str(len(curve))
n = str(len(curve) - 2)
self.stats[n] = self.stats.get(n, 0) + 1
for curve in curves:
if len(curve) == 4:

View File

@ -30,9 +30,9 @@ def _font_to_cubic(input_path, output_path=None, **kwargs):
ttpen = TTGlyphPen(glyphSet)
pen = Qu2CuPen(ttpen, **qu2cu_kwargs)
glyph.draw(pen)
glyf[glyphName] = ttpen.glyph(preserveTopology=False)
glyf[glyphName] = ttpen.glyph(dropImpliedOnCurves=True)
if stats["4"]: # 4 means a cubic segment
if stats["2"]: # 2 means a cubic segment
font["head"].glyphDataFormat = 1
if kwargs["dump_stats"]: