diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 7c54bbd..bebf1ab 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -47,4 +47,4 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | coverage run setup.py test - coveralls + coveralls --service=github diff --git a/src/ufonormalizer/__init__.py b/src/ufonormalizer/__init__.py index d891773..1f16a99 100644 --- a/src/ufonormalizer/__init__.py +++ b/src/ufonormalizer/__init__.py @@ -524,9 +524,9 @@ def _normalizeDictGuideline(guideline): # The spec was ambiguous about y=0 or x=0, so don't raise an error here, # instead, or are allowed, and the 0 becomes None. if angle is None: - if x == 0: + if x == 0 and y is not None: x = None - if y == 0: + if y == 0 and x is not None: y = None # either x or y must be defined if x is None and y is None: diff --git a/tests/test_ufonormalizer.py b/tests/test_ufonormalizer.py index 09dbcd4..4589f80 100644 --- a/tests/test_ufonormalizer.py +++ b/tests/test_ufonormalizer.py @@ -710,6 +710,13 @@ def test_normalizeFontInfoPlist_guidelines_vertical_y_is_zero(self): _normalizeGlifGuideline(element, writer) self.assertEqual(writer.getText(), '') + def test_normalizeFontInfoPlist_guidelines_vertical_y_is_zero2(self): + # Actually a vertical guide + element = ET.fromstring("") + writer = XMLWriter(declaration=None) + _normalizeGlifGuideline(element, writer) + self.assertEqual(writer.getText(), '') + def test_normalizeFontInfoPlist_guidelines_horizontal_x_is_zero(self): # Actually an horizontal guide element = ET.fromstring("") @@ -717,6 +724,13 @@ def test_normalizeFontInfoPlist_guidelines_horizontal_x_is_zero(self): _normalizeGlifGuideline(element, writer) self.assertEqual(writer.getText(), '') + def test_normalizeFontInfoPlist_guidelines_horizontal_x_is_zero2(self): + # Actually an horizontal guide + element = ET.fromstring("") + writer = XMLWriter(declaration=None) + _normalizeGlifGuideline(element, writer) + self.assertEqual(writer.getText(), '') + def test_normalizeGLIF_lib_defined(self): e = '''