Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_axis_mapping(data_dir):
designspace = designspaceLib.DesignSpaceDocument.fromfile(
data_dir / "DesignspaceTest" / "DesignspaceTest-wght-wdth.designspace"
)
generator = fontmake.instantiator.Instantiator.from_designspace(
designspace, round_geometry=True
)
instance_font = generator.generate_instance(designspace.instances[0])
assert instance_font.info.openTypeOS2WeightClass == 400
assert instance_font.info.openTypeOS2WidthClass == 5
assert instance_font.info.italicAngle is None
assert instance_font.lib["designspace.location"] == [
("weight", 100.0),
("width", 100.0),
]