diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 122475c..415295d 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -18,13 +18,9 @@ jobs: if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')" strategy: matrix: - python-version: ['3.9', '3.11', '3.12', '3.13', '3.14'] + python-version: ['3.11', '3.12', '3.13', '3.14', '3.15'] platform: [ubuntu-latest, macos-latest, windows-latest] exclude: # Only test on the oldest and latest supported stable Python on macOS and Windows. - - platform: macos-latest - python-version: 3.11 - - platform: windows-latest - python-version: 3.11 - platform: macos-latest python-version: 3.12 - platform: windows-latest @@ -33,6 +29,10 @@ jobs: python-version: 3.13 - platform: windows-latest python-version: 3.13 + - platform: macos-latest + python-version: 3.14 + - platform: windows-latest + python-version: 3.14 steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} diff --git a/Lib/fontMath/mathGlyph.py b/Lib/fontMath/mathGlyph.py index ab7a27b..c676059 100644 --- a/Lib/fontMath/mathGlyph.py +++ b/Lib/fontMath/mathGlyph.py @@ -660,6 +660,8 @@ def _pairComponents(components1, components2): baseGlyph = component1["baseGlyph"] identifier = component1["identifier"] match = None + if identifier is None: + continue # Two absent identifiers are not a match. for component2 in components2: if component2["baseGlyph"] == baseGlyph and component2["identifier"] == identifier: match = component2 diff --git a/Lib/fontMath/test/test_mathGlyph.py b/Lib/fontMath/test/test_mathGlyph.py index 55785a2..087d729 100644 --- a/Lib/fontMath/test/test_mathGlyph.py +++ b/Lib/fontMath/test/test_mathGlyph.py @@ -983,6 +983,35 @@ def test_processMathTwoComponents(self): ], ) + def test_pairComponentsMissingIdentifier(self): + """Test that the order of components is preserved in the absence of + matching identifiers.""" + + name = "period" + t_top = (1, 0, 0, 1, 0, 234) + t_bot = (1, 0, 0, 1, 0, -123) + colon1 = [ + {"baseGlyph": name, "transformation": t_top, "identifier": None}, + {"baseGlyph": name, "transformation": t_bot, "identifier": "hello"}, + ] + colon2 = [ + {"baseGlyph": name, "transformation": t_top, "identifier": "world"}, + {"baseGlyph": name, "transformation": t_bot, "identifier": None}, + ] + self.assertEqual( + _pairComponents(colon1, colon2), + [ + ( + {"baseGlyph": name, "transformation": t_top, "identifier": None}, + {"baseGlyph": name, "transformation": t_top, "identifier": "world"}, + ), + ( + {"baseGlyph": name, "transformation": t_bot, "identifier": "hello"}, + {"baseGlyph": name, "transformation": t_bot, "identifier": None}, + ), + ], + ) + def test_expandImage(self): self.assertEqual( _expandImage(None), diff --git a/tox.ini b/tox.ini index 774214e..c650f1c 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py3{9, 10, 12, 13, 14}-cov, htmlcov +envlist = py3{11, 12, 13, 14, 15}-cov, htmlcov skip_missing_interpreters = true [testenv]