From 7c0ed18c6a656eeac12e0df69693cfb4300b4c8d Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Mon, 30 Oct 2017 18:54:00 +0000 Subject: [PATCH 1/2] Bump minimum required fonttools to 3.18.0 we need that for the bugfix in ReverseContourPen https://github.com/googlei18n/cu2qu/issues/51 also bump ufoLib to >= 2.1.1, just because. --- requirements.txt | 2 +- setup.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index c9984f7e9..8984eed6f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -fonttools==3.17.0 +fonttools==3.18.0 ufoLib==2.1.1 diff --git a/setup.py b/setup.py index 1b51870f3..067f65708 100644 --- a/setup.py +++ b/setup.py @@ -172,8 +172,8 @@ setup( 'pytest>=2.8', ], install_requires=[ - "fonttools>=3.1.2", - "ufoLib>=2.1.0", + "fonttools>=3.18.0", + "ufoLib>=2.1.1", ], cmdclass={ "release": release, From df10cdea05a98fd3183caf76567274ca643d0088 Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Mon, 30 Oct 2017 18:56:02 +0000 Subject: [PATCH 2/2] Use fonttools' ReverseContourPen Fixes #51 --- Lib/cu2qu/pens.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Lib/cu2qu/pens.py b/Lib/cu2qu/pens.py index a827ba246..7e084528d 100644 --- a/Lib/cu2qu/pens.py +++ b/Lib/cu2qu/pens.py @@ -1,6 +1,7 @@ from __future__ import print_function, division, absolute_import from cu2qu import curve_to_quadratic from fontTools.pens.basePen import AbstractPen, decomposeSuperBezierSegment +from fontTools.pens.reverseContourPen import ReverseContourPen try: from ufoLib.pointPen import AbstractPointPen, BasePointToSegmentPen @@ -227,12 +228,3 @@ class Cu2QuPointPen(BasePointToSegmentPen): def addComponent(self, baseGlyphName, transformation): assert self.currentPath is None self.pen.addComponent(baseGlyphName, transformation) - - -class ReverseContourPen(SegmentToPointPen): - """ Same as 'ReverseContourPointPen' but using the SegmentPen protocol. """ - - def __init__(self, other_pen): - adapter_point_pen = PointToSegmentPen(other_pen) - reverse_point_pen = ReverseContourPointPen(adapter_point_pen) - SegmentToPointPen.__init__(self, reverse_point_pen)