/usr/lib/python3/dist-packages/defcon/pens/transformPointPen.py is in python3-defcon 0.3.5-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | from ufoLib.pointPen import AbstractPointPen
class TransformPointPen(AbstractPointPen):
"""PointPen that transforms all coordinates, and passes them to another
PointPen. It also transforms the transformation given to addComponent().
"""
def __init__(self, outPen, transformation):
if not hasattr(transformation, "transformPoint"):
from fontTools.misc.transform import Transform
transformation = Transform(*transformation)
self._transformation = transformation
self._transformPoint = transformation.transformPoint
self._outPen = outPen
self._stack = []
def beginPath(self):
self._outPen.beginPath()
def endPath(self):
self._outPen.endPath()
def addPoint(self, pt, segmentType=None, smooth=False, name=None, **kwargs):
pt = self._transformPoint(pt)
self._outPen.addPoint(pt, segmentType, smooth, name, **kwargs)
def addComponent(self, glyphName, transformation):
transformation = self._transformation.transform(transformation)
self._outPen.addComponent(glyphName, transformation)
|