Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
Expand Down
2 changes: 2 additions & 0 deletions Lib/fontMath/mathGlyph.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
29 changes: 29 additions & 0 deletions Lib/fontMath/test/test_mathGlyph.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
Loading