From bae887f63793f8b2765c8de3c2b6ae85df9672a8 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 21 Nov 2024 13:21:22 -0700 Subject: [PATCH] [glyph] Add outputImpliedClosingLine to draw() This is in line with what `ufoLib` does. Fixes https://github.com/fonttools/fonttools/issues/3694 --- src/ufoLib2/objects/glyph.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ufoLib2/objects/glyph.py b/src/ufoLib2/objects/glyph.py index aba28b7d..6fe152e6 100644 --- a/src/ufoLib2/objects/glyph.py +++ b/src/ufoLib2/objects/glyph.py @@ -355,10 +355,12 @@ def move(self, delta: tuple[float, float]) -> None: # Pen methods # ----------- - def draw(self, pen: AbstractPen) -> None: + def draw(self, pen: AbstractPen, outputImpliedClosingLine: bool = False) -> None: """Draws glyph into given pen.""" # TODO: Document pen interface more or link to somewhere. - pointPen = PointToSegmentPen(pen) + pointPen = PointToSegmentPen( + pen, outputImpliedClosingLine=outputImpliedClosingLine + ) self.drawPoints(pointPen) def drawPoints(self, pointPen: AbstractPointPen) -> None: