Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
elif curve_type == "cubic":
pass # keep converting
else:
raise NotImplementedError(curve_type)
modified = super(CubicToQuadraticFilter, self).__call__(font, glyphSet)
if modified:
stats = self.context.stats
logger.info(
"New spline lengths: %s"
% (", ".join("%s: %d" % (l, stats[l]) for l in sorted(stats.keys())))
)
if self.options.rememberCurveType:
# 'lib' here is the layer's lib, as defined in for loop variable
curve_type = lib.get(CURVE_TYPE_LIB_KEY, "cubic")
if curve_type != "quadratic":
lib[CURVE_TYPE_LIB_KEY] = "quadratic"
return modified
def __call__(self, font, glyphSet=None):
if self.options.rememberCurveType:
# check first in the global font lib, then in layer lib
for lib in (font.lib, getattr(glyphSet, "lib", {})):
curve_type = lib.get(CURVE_TYPE_LIB_KEY, "cubic")
if curve_type == "quadratic":
logger.info("Curves already converted to quadratic")
return set()
elif curve_type == "cubic":
pass # keep converting
else:
raise NotImplementedError(curve_type)
modified = super(CubicToQuadraticFilter, self).__call__(font, glyphSet)
if modified:
stats = self.context.stats
logger.info(
"New spline lengths: %s"
% (", ".join("%s: %d" % (l, stats[l]) for l in sorted(stats.keys())))
)