21 Commits

Author SHA1 Message Date
Nikolaus Waxweiler
a3acb1426b Remove py23 import 2021-01-29 22:23:27 +00:00
Nikolaus Waxweiler
01328213c7 Remove __future__ imports 2019-08-09 12:20:13 +01:00
Behdad Esfahbod
2d4e76ff0b [bezierTools] Add calcCubicArcLength() and calcCubicArcLengthC()
Fixes https://github.com/fonttools/fonttools/issues/1142
2018-01-09 11:33:57 +01:00
Jens Kutilek
dd558f5df8 Move arc length calculations from pens.perimeterPen to misc.bezierTools 2017-11-14 13:03:58 +01:00
Behdad Esfahbod
f3bfea12c6 Add __all__ to pens that didn't have it 2017-02-21 12:01:10 -06:00
Behdad Esfahbod
821ea7385f Minor 2017-02-21 12:01:10 -06:00
Behdad Esfahbod
8712c20156 [perimeterPen] Use Gauss-Legendre instead of Lobatto-Gauss for qudratic
Uses one fewer point and is no uglier.
2017-02-20 11:16:12 -06:00
Behdad Esfahbod
6738305fb1 [perimeterPoint] Minor 2017-02-20 11:09:14 -06:00
Behdad Esfahbod
3d4bd76a76 [perimeterPen] Add Gauss-Lobatto implementation for quadratic Bezier as well
Is twice faster than the exact algorithm.
2017-02-20 10:17:07 -06:00
Behdad Esfahbod
9f1067a991 [perimeterPen] Optimize Lobatto code 2017-02-20 10:17:07 -06:00
Cosimo Lupo
a226c4772b
[perimeterPen] move source encoding declaration to the first line
Otherwise I get this error on python2.7:

SyntaxError: Non-ASCII character '\xc2' in file perimeterPen.py on line 87, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
2017-02-19 20:08:57 -08:00
Behdad Esfahbod
3e74798499 [perimeterPen] Add Gauss-Lobatto quadrature approximation implementation
Is about 30 percent faster than recursive approach for the default .005
error tolerance.  To be optimized more.
2017-02-19 16:08:21 -06:00
Behdad Esfahbod
25083502e4 [perimeterPen] Update check for cusps
If p1 coincides with p0 or p2, we still can use the lineTo()
code.
2016-11-08 16:39:38 -08:00
Behdad Esfahbod
a71faf9322 [perimeterPen] 5x speed-up cubic by using complex numbers as points 2016-10-30 14:28:38 +02:00
Behdad Esfahbod
c5538eaccf [perimeterPen] Speed up quadratic by using complex numbers for points 2016-10-30 14:28:33 +02:00
Behdad Esfahbod
a284865851 Remove unused line 2016-10-30 14:28:07 +02:00
Behdad Esfahbod
b0b049774c Implement analytical curve length for quadratic beziers
This is multiple times faster, and tolerance-independent.

I'll explain how I arrived at this later.
2016-06-13 20:08:50 -04:00
Behdad Esfahbod
56c27f45c9 Speed up perimeterPen
It's still too slow, but an improvement.

Also, remove duplicate copy from symfont.
2016-06-13 18:50:01 -04:00
Miguel Sousa
92e8455259 perimeterPen.py: make glyphset the first argument (like in all other pens) 2016-06-12 15:46:04 -07:00
Cosimo Lupo
c5ed6c6456 perimeterPen.py: handle implied lineTo in closePath 2016-06-12 11:49:00 +01:00
Cosimo Lupo
c08e47ed47 perimeterPen.py: copy PerimeterPen from symfont.py 2016-06-11 23:07:23 +01:00