-
Notifications
You must be signed in to change notification settings - Fork 447
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
TypeError
from _intSecAtan
on previously valid arguments (valid before 4.40.0)
#3287
Comments
TypeError
from _intSecAtan
on previously valid arguments (<=4.39.0)TypeError
from _intSecAtan
on previously valid arguments (valid before 4.40.0)
Seems like a regression, thanks for the report, I will take a look at it today |
I wonder if it relates to #3121. The failing code is optionally optimized by cython, but has otherwise not been changed in a while. |
argh.. yes seems to be related to cython, again..(6012643) |
actually in this case cython might be right.. the value is wrongly typed, it should have been typed as double, not as complex: diff --git a/Lib/fontTools/misc/bezierTools.py b/Lib/fontTools/misc/bezierTools.py
index 7772a4bf8..21ab0a5d0 100644
--- a/Lib/fontTools/misc/bezierTools.py
+++ b/Lib/fontTools/misc/bezierTools.py
@@ -141,7 +141,7 @@ def _dot(v1, v2):
@cython.cfunc
@cython.inline
@cython.returns(cython.double)
-@cython.locals(x=cython.complex)
+@cython.locals(x=cython.double)
def _intSecAtan(x):
# In : sympy.integrate(sp.sec(sp.atan(x)))
# Out: x*sqrt(x**2 + 1)/2 + asinh(x)/2 this fixes it. |
Hi fontTools — long time fan, first time issue reporter — apologies if this has already been reported, but I've been using fontPen’s
FlattenPen
in coordination with ttf variable fonts for a number of years now with no issue, but when I recently updated a fontTools install (as a requirement of a fontmake install), I started getting this error whenever I tried to use the FlattenPen on glyphs with quadratic curves.After some investigating, I narrowed the issue down to FlattenPen calling
calcQuadraticArcLength
and then, in turn, that function calling_intSecAtan
— fontTools 4.39.0 works fine for all of my use cases, but 4.40.0 introduces the issue.Here's an example traceback, with a minimal example (a direct call to
calcQuadraticArcLength
):Not sure if it's of any value, but I put together a small repo to demonstrate the issue here: https://github.com/stenson/flattentest. My main issue is demonstrated in test.py, with this code snippet:
As far as I know, I'm not doing anything out of the ordinary here, but I get the
TypeError
with all recent versions of fontTools.The text was updated successfully, but these errors were encountered: