17 Commits

Author SHA1 Message Date
Cosimo Lupo
e755f58515
pens: add workaround for BasePointToSegmentPen bug
Fixes https://github.com/trufont/trufont/issues/595

We shall remove this workaround once ufoLib is fixed upstream
2018-10-11 18:37:54 +01:00
Cosimo Lupo
6c22995a5f pens: deprecate 'ignore_single_points' argument
This was needed for when we were supporting the old robofab.ufoLib
where anchors were represented as single-point-with-a-name contours.
With latest ufoLib, even when glif format is 1, anchors are
stored separately and are not drawn with pens (only proper contours
and components are passed on in the draw method).
So there is no longer need to special-case single points.
It's not the job of the cu2qu pens to filter those out.
2017-10-31 17:57:53 +00:00
Cosimo Lupo
af0a06081a remove robofab imports
fonts_to_quadratic may still work with Robofab fonts, it's just
that the point pens will be imported from standalone ufoLib
2017-10-31 12:35:26 +00:00
Cosimo Lupo
df10cdea05 Use fonttools' ReverseContourPen
Fixes #51
2017-10-30 18:56:02 +00:00
Cosimo Lupo
13abea3ca5 [pens] fix number of segments reported in stats
It appears we were reporting the 'stats' differently in the pens and
in the main ufo module.

https://github.com/googlei18n/cu2qu/blob/7a2f638/Lib/cu2qu/ufo.py#L148

You can git blame me, sorry.
Funny how it's been broken for almost two years :)
2017-10-25 18:49:19 +01:00
Cosimo Lupo
153404077d
[pens] remove ReverseContourPointPen copy; import it from ufoLib (v2.1.0)
... or from robofab (I haven't tested the latter though)
2017-05-24 19:05:14 +01:00
James Godfrey-Kittle
039e35b212 No error returned from API, update tests 2016-07-27 13:21:47 -07:00
Cosimo Lupo
ae2eb8d4df cu2qu.pens: make sure closed contour starts with an on-curve
This is still the same contour as before, as UFO spec allows both;
it's just normalized so that the first segments' off-curves appear at
the bottom, and the first point in the contour is an on-curve.
2016-07-21 11:35:41 +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