diff options
| author | Felipe Corrêa da Silva Sanches | 2015-09-28 12:40:00 -0300 | 
|---|---|---|
| committer | Adrien Tétar | 2015-09-29 11:47:49 +0200 | 
| commit | 51a80dc8ce5cb7f41111b2cbc3b0fb53f1966016 (patch) | |
| tree | dd1370ea2f9c29258d984ae937d7c9161a0c90d2 /Lib/defconQt/representationFactories/glyphViewFactory.py | |
| parent | 57aa7ed59d8e067717e965ef57f7f68a015fc2f3 (diff) | |
| download | trufont-51a80dc8ce5cb7f41111b2cbc3b0fb53f1966016.tar.bz2 | |
generating multiple paths when dealing with multiple components
Diffstat (limited to 'Lib/defconQt/representationFactories/glyphViewFactory.py')
| -rw-r--r-- | Lib/defconQt/representationFactories/glyphViewFactory.py | 16 | 
1 files changed, 10 insertions, 6 deletions
diff --git a/Lib/defconQt/representationFactories/glyphViewFactory.py b/Lib/defconQt/representationFactories/glyphViewFactory.py index fe5183d..1b96cdc 100644 --- a/Lib/defconQt/representationFactories/glyphViewFactory.py +++ b/Lib/defconQt/representationFactories/glyphViewFactory.py @@ -29,15 +29,17 @@ class NoComponentsQtPen(QtPen):  def OnlyComponentsQPainterPathFactory(glyph, font):
      pen = OnlyComponentsQtPen(font)
      glyph.draw(pen)
 -    pen.path.setFillRule(Qt.WindingFill)
 -    return pen.path
 +    return pen.getData()
  class OnlyComponentsQtPen(BasePen):
      def __init__(self, glyphSet):
          BasePen.__init__(self, glyphSet)
 -        self.pen = QtPen(glyphSet)
 -        self.path = self.pen.path
 +        self._glyphSet = glyphSet
 +        self.paths = []
 +
 +    def getData(self):
 +      return self.paths
      def _moveTo(self, p):
          pass
 @@ -57,9 +59,11 @@ class OnlyComponentsQtPen(BasePen):          except KeyError:
              return
          else:
 -            tPen = TransformPen(self.pen, transformation)
 +            pen = QtPen(self._glyphSet)
 +            pen.path.setFillRule(Qt.WindingFill)
 +            tPen = TransformPen(pen, transformation)
              glyph.draw(tPen)
 -
 +            self.paths.append(pen.path)
  # ----------
  # point data
  | 
