James Godfrey-Kittle
c82ca16fde
Merge pull request #20 from anthrotype/pens
...
add pens module containing Cu2QuPen, Cu2QuPointPen, etc.
2016-04-21 11:25:59 -07:00
James Godfrey-Kittle
bdfc3fa7c9
Merge pull request #22 from googlei18n/py3ufo3
...
Python 3, ufo3 compatibility
2016-04-05 11:40:02 -07:00
James Godfrey-Kittle
7fe4fd0fe2
[ufo] Don't touch components or UFO2-style anchors
2016-04-05 10:41:48 -07:00
James Godfrey-Kittle
802bb813f5
[ufo] Changes for python 3 compatibility
2016-04-05 10:37:07 -07:00
James Godfrey-Kittle
b1087a138f
Remove old robofab reference in readme
2016-04-05 10:34:51 -07:00
James Godfrey-Kittle
f6853d0e48
Merge pull request #21 from googlei18n/defcon
...
Defcon compatibility
2016-04-04 17:49:03 -07:00
James Godfrey-Kittle
983307d9cd
[ufo] Allow input fonts with quadratic curves
2016-04-04 17:30:33 -07:00
James Godfrey-Kittle
0ec7495516
[ufo] Handle endPath
2016-04-04 16:08:15 -07:00
James Godfrey-Kittle
b8fa142bef
[ufo] Clear existing contours when adding new ones
2016-04-04 15:30:39 -07:00
James Godfrey-Kittle
17e25e8ec9
Rename rf module to ufo
2016-04-04 15:18:27 -07:00
James Godfrey-Kittle
7b816131f8
Make UFO code non-robofab specific
2016-04-04 15:15:05 -07:00
Cosimo Lupo
219efbc6f0
[test.utils] typo
2016-03-25 20:09:14 +01:00
Cosimo Lupo
b13eceb0f9
[setup.py] add 'test_suite' to enable python setup.py test
...
also, add test *.glif files to package_data, so users can run test modules against the installed cu2qu by doing e.g.:
```
python -m cu2qu.test.pens_test
```
2016-03-25 19:55:39 +01:00
Cosimo Lupo
a21c388355
[test.pens_test] add test module for Cu2Qu pens
2016-03-25 19:55:39 +01:00
Cosimo Lupo
5f8bb98107
[test.utils] add dummy pen and glyph classes to use with unit tests
2016-03-25 19:55:38 +01:00
Cosimo Lupo
2a6feb01be
[test] add __init__.py to turn 'test' into a sub-package
2016-03-25 19:55:38 +01:00
Cosimo Lupo
072a60da97
create test folder; add test .glif files
2016-03-25 19:55:38 +01:00
Cosimo Lupo
a246bcfdbd
[pens] add "super bezier" support to Cu2QuPointPen
2016-03-25 19:55:38 +01:00
Cosimo Lupo
8e3c6ce5a2
[pens] minor comments and assertion error message
2016-03-25 19:55:08 +01:00
Cosimo Lupo
c5bd215e2f
[pens] add assertions esuring that Cu2QuPen methods are called in the right order
2016-03-25 14:26:33 +01:00
Cosimo Lupo
a79ea7e126
[pens] set smooth=False for offcurve points in new quadratic segments
2016-03-18 15:41:44 +00:00
Cosimo Lupo
4f6d04bcf3
[pens] don't use super() for compat with robofab's old-style classes
2016-03-18 15:40:16 +00:00
Cosimo Lupo
84f24b189b
[pens] fix imports for robofab pens
2016-03-16 18:58:06 +00:00
Cosimo Lupo
9fcca0f5c5
[pens] call lineTo if len(points) == 1 in qCurveTo()
...
we were alrady doing that in curveTo, so we might well do it here too
2016-03-16 10:39:06 +00:00
Cosimo Lupo
adaa9fc242
[pens] add docstrings; make ignore_single_points=False by default
2016-03-16 10:14:05 +00:00
Cosimo Lupo
a7ed9c8cc1
add pens module containing Cu2QuPen, Cu2QuPointPen, ReverseContourPen and ReverseContourPointPen
...
I copied the ReverseContourPointPen from the robofab.pens. I think it's useful for the Cu2QuPen to
have a `reverse_direction` argument which inverts the contours' winding direction. I didn't want to
add a dependency on robofab, since things are in transitions... We will add it to the future "penBox"
package (or whatever it'll be called) once that is set up.
2016-03-15 19:49:23 +00:00
James Godfrey-Kittle
7014fc7c3a
Merge pull request #19 from googlei18n/no-rounding
...
[robofab] Don't round new points
2016-02-16 17:58:07 -08:00
James Godfrey-Kittle
6fd3f19f2d
[robofab] Don't round new points
...
It doesn't seem to be a good idea to round some points in a glyph but
not others. With this change, control points (which don't change)
that were equivalent to other non-curve points before conversion will
remain so. This can be significant when drawing with pen objects.
The rounding has been there since the initial commit; it's not clear
that it serves a purpose.
2016-02-11 17:51:35 -08:00
James Godfrey-Kittle
d4913e3077
[minor] Use setuptools in setup.py
2016-02-11 17:44:57 -08:00
James Godfrey-Kittle
49defc4e80
Merge pull request #18 from googlei18n/api
...
API changes
2015-12-11 10:53:09 -08:00
jamesgk
3c3c579ab1
Assert # error tolerances matches # fonts/curves
2015-12-10 12:50:53 -08:00
jamesgk
2dfd8aec76
Add convenience function font_to_quadratic
2015-12-10 12:20:39 -08:00
jamesgk
555ff7c43f
Accept error tolerances as lists or tuples
...
This way you can designate different tolerances for different fonts,
which may be useful for example with fonts of different weights.
2015-12-10 12:19:15 -08:00
jamesgk
f7c251e9a2
Rename "report" parameter to "stats"
...
This also makes the stats parameter optional in the other public rf
module functions.
2015-12-08 14:21:44 -08:00
jamesgk
56f36a1b2a
[API] Take in list of fonts, no **kwarg syntax
...
This is hopefully the last non-backwards-compatible API change. We
take a list of fonts in rf.fonts_to_quadratic so that we can spell out
its keyword arguments explicitly. Also, only one max error argument is
accepted.
2015-12-08 14:19:57 -08:00
jamesgk
b568c934d0
Remove max_n parameter
...
This is probably not useful as a parameter, so instead we hardcode the
value into the main module.
2015-12-08 12:44:29 -08:00
jamesgk
856ffe1fca
Make only a few functions public
...
This way we hopefully don't have to worry about changing things behind
the scenes.
2015-12-08 12:42:42 -08:00
James Godfrey-Kittle
b6ae3f4b58
Merge pull request #17 from anthrotype/return-error
...
Return (spline, error) tuple from approximation functions
2015-12-08 11:58:59 -08:00
Cosimo Lupo
e6b47d61c9
cu2qu.rf: only get fist item returned from curve_to_quadratic, ignore approx error
...
curve_to_quadratic and curves_to_quadratic now return a (spline, error) tuple.
2015-12-07 15:09:26 +00:00
Cosimo Lupo
4dffdb7dd7
cu2qu.__init__: return (spline[s], error[s]) tuple from curve[s]_to_quadratic; raise exception if no approximation is found; ensure returned spline is a list of tuples
2015-12-07 15:09:26 +00:00
Behdad Esfahbod
1ab0631ba4
Merge pull request #16 from googlei18n/py23
...
Use __future__ imports to ease Python2/3 compat
2015-12-04 22:44:53 -08:00
jamesgk
a79fb041a2
Use __future__ imports to ease Python2/3 compat
2015-12-04 13:07:32 -08:00
Behdad Esfahbod
aba3051aac
[benchmark] Print time in micro-seconds
2015-12-03 18:13:27 -08:00
Behdad Esfahbod
1665774752
Merge pull request #15 from googlei18n/optimize
...
Remove Point class and only use built-ins
2015-12-03 17:53:13 -08:00
jamesgk
72ebeb1085
Add license to benchmark script
2015-12-01 17:28:19 -08:00
jamesgk
3d4a7872ab
Add a benchmarking suite for curve/s_to_quadratic
2015-12-01 17:13:14 -08:00
jamesgk
a787cd2daf
Pass tuples to curves_to_quadratic in rf module
2015-12-01 17:12:30 -08:00
jamesgk
561bed0ea0
Remove Point class and only use built-ins
...
Using built-in types (mostly tuples) seems to cut the running time
overall by about one half. Spelling out linear interpolation in the
bezier_at functions actually cuts the running time by another 10%,
but I'm not sure if it's worth it given that this code looks a bit
nicer.
2015-12-01 13:22:24 -08:00
Behdad Esfahbod
bb79a8bf62
Merge pull request #14 from googlei18n/api
...
Move geometry module to __init__
2015-12-01 13:03:08 -08:00
jamesgk
97ce534d7b
Move geometry.py to __init__.py
2015-12-01 12:30:31 -08:00