Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[instancer-solver] Fix a bug #3140

Merged
merged 1 commit into from
May 30, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Lib/fontTools/varLib/instancer/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def _solve(tent, axisLimit, negative=False):
# Crossing point on the axis.
crossing = peak + ((1 - gain) * (upper - peak) / (1 - outGain))

loc = (peak, peak, crossing)
loc = (axisDef, peak, crossing)
scalar = 1

# The part before the crossing point.
Expand Down
13 changes: 12 additions & 1 deletion Tests/varLib/instancer/solver_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,18 @@ class RebaseTentTest(object):
(1, (0, 0.4, 1.99994)),
],
),
# https://github.com/fonttools/fonttools/issues/3139
pytest.param(
(0, 0.5, 1),
(-1, 0.25, 1),
[
(0.5, None),
(0.5, (0.0, 1 / 3, 2 / 3)),
(-0.5, (2 / 3, 1, 1)),
(-0.5, (-1, -0.2, 0)),
(-0.5, (-1, -1, -0.2)),
],
),
# Dirac delta at new default. Fancy!
pytest.param(
(0.5, 0.5, 0.5),
Expand All @@ -233,7 +245,6 @@ class RebaseTentTest(object):
],
)
def test_rebaseTent(self, tent, axisRange, expected):

sol = solver.rebaseTent(tent, axisRange)

a = pytest.approx
Expand Down