Skip to content

Commit d916faa

Browse files
committed
fixing angleMarginPen
fixing #45
1 parent d8d26fe commit d916faa

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

Lib/fontPens/angledMarginPen.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,30 +40,18 @@ def _getAngled(self, pt):
4040
def _moveTo(self, pt):
4141
self._start = self.currentPoint = pt
4242

43-
def _addMoveTo(self):
44-
if self._start is None:
45-
return
46-
self._start = self.currentPoint = None
47-
4843
def _lineTo(self, pt):
49-
self._addMoveTo()
5044
self._getAngled(pt)
5145
self.currentPoint = pt
5246

5347
def _curveToOne(self, pt1, pt2, pt3):
54-
self._addMoveTo()
5548
step = 1.0 / self.maxSteps
5649
factors = range(0, self.maxSteps + 1)
5750
for i in factors:
5851
pt = getCubicPoint(i * step, self.currentPoint, pt1, pt2, pt3)
5952
self._getAngled(pt)
6053
self.currentPoint = pt3
6154

62-
def _qCurveToOne(self, bcp, pt):
63-
self._addMoveTo()
64-
self._getAngled(pt)
65-
self.currentPoint = pt
66-
6755

6856
def getAngledMargins(glyph, font):
6957
"""
@@ -79,7 +67,7 @@ def setAngledLeftMargin(glyph, font, value):
7967
Convenience function, sets the left angled margin to value. Adjusted for font.info.italicAngle.
8068
"""
8169
pen = AngledMarginPen(font, glyph.width, font.info.italicAngle)
82-
g.draw(pen)
70+
glyph.draw(pen)
8371
isLeft, isRight = pen.margin
8472
glyph.leftMargin += value - isLeft
8573

@@ -89,7 +77,7 @@ def setAngledRightMargin(glyph, font, value):
8977
Convenience function, sets the right angled margin to value. Adjusted for font.info.italicAngle.
9078
"""
9179
pen = AngledMarginPen(font, glyph.width, font.info.italicAngle)
92-
g.draw(pen)
80+
glyph.draw(pen)
9381
isLeft, isRight = pen.margin
9482
glyph.rightMargin += value - isRight
9583

@@ -99,7 +87,7 @@ def centerAngledMargins(glyph, font):
9987
Convenience function, centers the glyph on angled margins.
10088
"""
10189
pen = AngledMarginPen(font, glyph.width, font.info.italicAngle)
102-
g.draw(pen)
90+
glyph.draw(pen)
10391
isLeft, isRight = pen.margin
10492
setAngledLeftMargin(glyph, font, (isLeft + isRight) * .5)
10593
setAngledRightMargin(glyph, font, (isLeft + isRight) * .5)

0 commit comments

Comments
 (0)