How to use the ufonormalizer._normalizeGlifContourFormat1 function in ufonormalizer

To help you get started, we’ve selected a few ufonormalizer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github unified-font-object / ufoNormalizer / tests / test_ufonormalizer.py View on Github external
def test_normalizeGlif_contour_format1_implied_anchor_without_name(self):
        contour = '''
        
           
        
        '''
        element = ET.fromstring(contour)
        self.assertEqual(
            sorted(_normalizeGlifContourFormat1(element).items()),
            [('type', 'anchor'), ('x', 0.0), ('y', 0.0)])
github unified-font-object / ufoNormalizer / tests / test_ufonormalizer.py View on Github external
def test_normalizeGlif_contour_format1_implied_anchor(self):
        contour = '''
        
           
        
        '''
        element = ET.fromstring(contour)
        self.assertEqual(
            sorted(_normalizeGlifContourFormat1(element).items()),
            [('name', 'anchor1'), ('type', 'anchor'), ('x', 0.0), ('y', 0.0)])
github unified-font-object / ufoNormalizer / tests / test_ufonormalizer.py View on Github external
def test_normalizeGlif_contour_format1_unkown_child_element(self):
        contour = '''
        
           
        
        '''
        element = ET.fromstring(contour)
        self.assertIsNone(_normalizeGlifContourFormat1(element))
github unified-font-object / ufoNormalizer / tests / test_ufonormalizer.py View on Github external
result = _normalizeGlifContourFormat1(element)
        result["type"]
        'contour'
        self.assertEqual(len(result["points"]), 1)
        self.assertEqual(
            sorted(result["points"][0].items()),
            [('type', 'line'), ('x', 0.0), ('y', 0.0)])

        contour = '''
        
           
           
        
        '''
        element = ET.fromstring(contour)
        result = _normalizeGlifContourFormat1(element)
        result["type"]
        'contour'
        self.assertEqual(len(result["points"]), 2)
        self.assertEqual(
            sorted(result["points"][0].items()),
            [('type', 'move'), ('x', 0.0), ('y', 0.0)])
        self.assertEqual(
            sorted(result["points"][1].items()),
            [('type', 'line'), ('x', 1.0), ('y', 1.0)])
github unified-font-object / ufoNormalizer / tests / test_ufonormalizer.py View on Github external
def test_normalizeGlif_contour_format1_empty(self):
        contour = '''
        
        '''
        element = ET.fromstring(contour)
        self.assertIsNone(_normalizeGlifContourFormat1(element))

        contour = '''
        
        
        '''
        element = ET.fromstring(contour)
        self.assertIsNone(_normalizeGlifContourFormat1(element))
github unified-font-object / ufoNormalizer / tests / test_ufonormalizer.py View on Github external
def test_normalizeGlif_contour_format1_implied_anchor_with_empty_name(self):
        contour = '''
        
           
        
        '''
        element = ET.fromstring(contour)
        self.assertEqual(
            sorted(_normalizeGlifContourFormat1(element).items()),
            [('name', ''), ('type', 'anchor'), ('x', 0.0), ('y', 0.0)])
github unified-font-object / ufoNormalizer / tests / test_ufonormalizer.py View on Github external
def test_normalizeGlif_contour_format1_implied_anchor(self):
        contour = '''
        
           
        
        '''
        element = ET.fromstring(contour)
        self.assertEqual(
            sorted(_normalizeGlifContourFormat1(element).items()),
            [('name', 'anchor1'), ('type', 'anchor'), ('x', 0.0), ('y', 0.0)])
github unified-font-object / ufoNormalizer / tests / test_ufonormalizer.py View on Github external
def test_normalizeGlif_contour_format1_unkown_point_type(self):
        contour = '''
        
           
        
        '''
        element = ET.fromstring(contour)
        self.assertIsNone(_normalizeGlifContourFormat1(element))
github unified-font-object / ufoNormalizer / tests / test_ufonormalizer.py View on Github external
def test_normalizeGlif_contour_format1_implied_anchor_without_name(self):
        contour = '''
        
           
        
        '''
        element = ET.fromstring(contour)
        self.assertEqual(
            sorted(_normalizeGlifContourFormat1(element).items()),
            [('type', 'anchor'), ('x', 0.0), ('y', 0.0)])
github unified-font-object / ufoNormalizer / tests / test_ufonormalizer.py View on Github external
def test_normalizeGlif_contour_format1_point_without_attributes(self):
        contour = '''
        
           
        
        '''
        element = ET.fromstring(contour)
        self.assertIsNone(_normalizeGlifContourFormat1(element))