fonttools/Lib/robofab/pens/quartzPen.py
Just van Rossum feb0046176 Moved Data, Lib and install.py one level down the tree
git-svn-id: http://svn.robofab.com/trunk@67 b5fa9d6c-a76f-4ffd-b3cb-f825fc41095c
2008-03-11 09:18:32 +00:00

22 lines
566 B
Python

from fontTools.pens.basePen import BasePen
class QuartzPen(BasePen):
"""Pen to draw onto a Quartz drawing context (Carbon.CG)."""
def __init__(self, glyphSet, quartzContext):
BasePen.__init__(self, glyphSet)
self._context = quartzContext
def _moveTo(self, (x, y)):
self._context.CGContextMoveToPoint(x, y)
def _lineTo(self, (x, y)):
self._context.CGContextAddLineToPoint(x, y)
def _curveToOne(self, (x1, y1), (x2, y2), (x3, y3)):
self._context.CGContextAddCurveToPoint(x1, y1, x2, y2, x3, y3)
def _closePath(self):
self._context.closePath()