diff options
Diffstat (limited to 'Lib/fontTools/pens/pointPen.py')
-rw-r--r-- | Lib/fontTools/pens/pointPen.py | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/Lib/fontTools/pens/pointPen.py b/Lib/fontTools/pens/pointPen.py index 55832181..26f99d41 100644 --- a/Lib/fontTools/pens/pointPen.py +++ b/Lib/fontTools/pens/pointPen.py @@ -11,8 +11,11 @@ steps through all the points in a call from glyph.drawPoints(). This allows the caller to provide more data for each point. For instance, whether or not a point is smooth, and its name. """ -from fontTools.pens.basePen import AbstractPen + import math +from typing import Any, Optional, Tuple + +from fontTools.pens.basePen import AbstractPen __all__ = [ "AbstractPointPen", @@ -24,26 +27,36 @@ __all__ = [ ] -class AbstractPointPen(object): - """ - Baseclass for all PointPens. - """ +class AbstractPointPen: + """Baseclass for all PointPens.""" - def beginPath(self, identifier=None, **kwargs): + def beginPath(self, identifier: Optional[str] = None, **kwargs: Any) -> None: """Start a new sub path.""" raise NotImplementedError - def endPath(self): + def endPath(self) -> None: """End the current sub path.""" raise NotImplementedError - def addPoint(self, pt, segmentType=None, smooth=False, name=None, - identifier=None, **kwargs): + def addPoint( + self, + pt: Tuple[float, float], + segmentType: Optional[str] = None, + smooth: bool = False, + name: Optional[str] = None, + identifier: Optional[str] = None, + **kwargs: Any + ) -> None: """Add a point to the current sub path.""" raise NotImplementedError - def addComponent(self, baseGlyphName, transformation, identifier=None, - **kwargs): + def addComponent( + self, + baseGlyphName: str, + transformation: Tuple[float, float, float, float, float, float], + identifier: Optional[str] = None, + **kwargs: Any + ) -> None: """Add a sub glyph.""" raise NotImplementedError |