pointInsidePen
fontTools.pens.pointInsidePen – Pen implementing “point inside” testing for shapes.
- class fontTools.pens.pointInsidePen.PointInsidePen(glyphSet, testPoint, evenOdd=False)[source]
Bases:
BasePen
This pen implements “point inside” testing: to test whether a given point lies inside the shape (black) or outside (white). Instances of this class can be recycled, as long as the setTestPoint() method is used to set the new point to test.
- Example:
pen = PointInsidePen(glyphSet, (100, 200)) outline.draw(pen) isInside = pen.getResult()
Both the even-odd algorithm and the non-zero-winding-rule algorithm are implemented. The latter is the default, specify True for the evenOdd argument of __init__ or setTestPoint to use the even-odd algorithm.