fonttools/Lib/ufoLib/pointPen.py
Tal Leming a43e586f8b Moved the adapter pen back to RoboFab.
git-svn-id: http://svn.robofab.com/branches/ufo3k@517 b5fa9d6c-a76f-4ffd-b3cb-f825fc41095c
2011-12-07 17:17:40 +00:00

38 lines
1000 B
Python

"""
=========
PointPens
=========
Where **SegmentPens** have an intuitive approach to drawing
(if you're familiar with postscript anyway), the **PointPen**
is geared towards accessing all the data in the contours of
the glyph. A PointsPen has a very simple interface, it just
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.
"""
__all__ = ["AbstractPointPen"]
class AbstractPointPen(object):
"""
Baseclass for all PointPens.
"""
def beginPath(self):
"""Start a new sub path."""
raise NotImplementedError
def endPath(self):
"""End the current sub path."""
raise NotImplementedError
def addPoint(self, pt, segmentType=None, smooth=False, name=None, **kwargs):
"""Add a point to the current sub path."""
raise NotImplementedError
def addComponent(self, baseGlyphName, transformation):
"""Add a sub glyph."""
raise NotImplementedError