[qu2cu] Adjust stats to match cu2qu
This commit is contained in:
parent
5125e9e095
commit
e72d195583
@ -52,7 +52,7 @@ class Qu2CuPen(ContourFilterPen):
|
|||||||
curves = quadratic_to_curves(q, self.max_err, all_cubic=self.all_cubic)
|
curves = quadratic_to_curves(q, self.max_err, all_cubic=self.all_cubic)
|
||||||
if self.stats is not None:
|
if self.stats is not None:
|
||||||
for curve in curves:
|
for curve in curves:
|
||||||
n = str(len(curve))
|
n = str(len(curve) - 2)
|
||||||
self.stats[n] = self.stats.get(n, 0) + 1
|
self.stats[n] = self.stats.get(n, 0) + 1
|
||||||
for curve in curves:
|
for curve in curves:
|
||||||
if len(curve) == 4:
|
if len(curve) == 4:
|
||||||
|
@ -30,9 +30,9 @@ def _font_to_cubic(input_path, output_path=None, **kwargs):
|
|||||||
ttpen = TTGlyphPen(glyphSet)
|
ttpen = TTGlyphPen(glyphSet)
|
||||||
pen = Qu2CuPen(ttpen, **qu2cu_kwargs)
|
pen = Qu2CuPen(ttpen, **qu2cu_kwargs)
|
||||||
glyph.draw(pen)
|
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
|
font["head"].glyphDataFormat = 1
|
||||||
|
|
||||||
if kwargs["dump_stats"]:
|
if kwargs["dump_stats"]:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user