From 11b2427f6123da3f91e1e5e94ae232dd90e70b0d Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 3 Feb 2023 11:17:14 -0700 Subject: [PATCH] [pointPen] Add addVarComponent to GuessSmoothPointPen --- Lib/fontTools/pens/pointPen.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Lib/fontTools/pens/pointPen.py b/Lib/fontTools/pens/pointPen.py index 5f7a8e7b0..7155a8168 100644 --- a/Lib/fontTools/pens/pointPen.py +++ b/Lib/fontTools/pens/pointPen.py @@ -421,6 +421,15 @@ class GuessSmoothPointPen(AbstractPointPen): kwargs["identifier"] = identifier self._outPen.addComponent(glyphName, transformation, **kwargs) + def addVarComponent( + self, glyphName, transformation, location, identifier=None, **kwargs + ): + if self._points is not None: + raise PenError("VarComponents must be added before or after contours") + if identifier is not None: + kwargs["identifier"] = identifier + self._outPen.addVarComponent(glyphName, transformation, location, **kwargs) + class ReverseContourPointPen(AbstractPointPen): """