diff --git a/Lib/fontTools/varLib/instancer/solver.py b/Lib/fontTools/varLib/instancer/solver.py index 9c568fe9a..ba5231b79 100644 --- a/Lib/fontTools/varLib/instancer/solver.py +++ b/Lib/fontTools/varLib/instancer/solver.py @@ -178,7 +178,9 @@ def _solve(tent, axisLimit, negative=False): # newUpper = peak + (1 - gain) * (upper - peak) assert axisMax <= newUpper # Because outGain > gain - if newUpper <= axisDef + (axisMax - axisDef) * 2: + # Disabled because ots doesn't like us: + # https://github.com/fonttools/fonttools/issues/3350 + if False and newUpper <= axisDef + (axisMax - axisDef) * 2: upper = newUpper if not negative and axisDef + (axisMax - axisDef) * MAX_F2DOT14 < upper: # we clamp +2.0 to the max F2Dot14 (~1.99994) for convenience diff --git a/Tests/varLib/instancer/instancer_test.py b/Tests/varLib/instancer/instancer_test.py index da6dd9ee0..0ace29f71 100644 --- a/Tests/varLib/instancer/instancer_test.py +++ b/Tests/varLib/instancer/instancer_test.py @@ -1986,7 +1986,10 @@ class LimitTupleVariationAxisRangesTest: TupleVariation({"wght": (0.0, 0.5, 1.0)}, [100, 100]), "wght", 0.6, - [TupleVariation({"wght": (0.0, 0.833334, 1.666667)}, [100, 100])], + [ + TupleVariation({"wght": (0.0, 0.833334, 1.0)}, [100, 100]), + TupleVariation({"wght": (0.833334, 1.0, 1.0)}, [80, 80]), + ], ), ( TupleVariation({"wght": (0.0, 0.2, 1.0)}, [100, 100]), @@ -2001,7 +2004,10 @@ class LimitTupleVariationAxisRangesTest: TupleVariation({"wght": (0.0, 0.2, 1.0)}, [100, 100]), "wght", 0.5, - [TupleVariation({"wght": (0.0, 0.4, 1.99994)}, [100, 100])], + [ + TupleVariation({"wght": (0.0, 0.4, 1)}, [100, 100]), + TupleVariation({"wght": (0.4, 1, 1)}, [62.5, 62.5]), + ], ), ( TupleVariation({"wght": (0.5, 0.5, 1.0)}, [100, 100]), @@ -2065,7 +2071,10 @@ class LimitTupleVariationAxisRangesTest: TupleVariation({"wght": (-1.0, -0.5, 0.0)}, [100, 100]), "wght", -0.6, - [TupleVariation({"wght": (-1.666667, -0.833334, 0.0)}, [100, 100])], + [ + TupleVariation({"wght": (-1.0, -0.833334, 0.0)}, [100, 100]), + TupleVariation({"wght": (-1.0, -1.0, -0.833334)}, [80, 80]), + ], ), ( TupleVariation({"wght": (-1.0, -0.2, 0.0)}, [100, 100]), @@ -2080,7 +2089,10 @@ class LimitTupleVariationAxisRangesTest: TupleVariation({"wght": (-1.0, -0.2, 0.0)}, [100, 100]), "wght", -0.5, - [TupleVariation({"wght": (-2.0, -0.4, 0.0)}, [100, 100])], + [ + TupleVariation({"wght": (-1.0, -0.4, 0.0)}, [100, 100]), + TupleVariation({"wght": (-1.0, -1.0, -0.4)}, [62.5, 62.5]), + ], ), ( TupleVariation({"wght": (-1.0, -0.5, -0.5)}, [100, 100]), diff --git a/Tests/varLib/instancer/solver_test.py b/Tests/varLib/instancer/solver_test.py index b9acf82f8..7bcab637f 100644 --- a/Tests/varLib/instancer/solver_test.py +++ b/Tests/varLib/instancer/solver_test.py @@ -43,7 +43,8 @@ class RebaseTentTest(object): (0, 0.2, 1), (-1, 0, 0.8), [ - (1, (0, 0.25, 1.25)), + (1, (0, 0.25, 1)), + (0.25, (0.25, 1, 1)), ], ), # Case 3 boundary @@ -51,7 +52,8 @@ class RebaseTentTest(object): (0, 0.4, 1), (-1, 0, 0.5), [ - (1, (0, 0.8, 1.99994)), + (1, (0, 0.8, 1)), + (2.5 / 3, (0.8, 1, 1)), ], ), # Case 4 @@ -234,7 +236,8 @@ class RebaseTentTest(object): (0, 0.2, 1), (0, 0, 0.5), [ - (1, (0, 0.4, 1.99994)), + (1, (0, 0.4, 1)), + (0.625, (0.4, 1, 1)), ], ), # https://github.com/fonttools/fonttools/issues/3139