Exemple #1
0
def apply_instance_data(instance_data):
    """Open instances, apply data, and re-save.

    Args:
        instance_data: List of (path, data) tuples, one for each instance.
    Returns:
        List of opened and updated instance UFOs.
    """
    from defcon import Font

    instance_ufos = []
    for path, data in instance_data:
        ufo = Font(path)
        set_custom_params(ufo, data=data)
        set_default_params(ufo)
        set_redundant_data(ufo)
        ufo.save()
        instance_ufos.append(ufo)
    return instance_ufos
Exemple #2
0
 def test_set_defaults(self):
     set_default_params(self.ufo)
     self.assertEqual(self.ufo.info.openTypeOS2Type, [3])
     self.assertEqual(self.ufo.info.postscriptUnderlinePosition, -100)
     self.assertEqual(self.ufo.info.postscriptUnderlineThickness, 50)