コード例 #1
0
ファイル: defcon.py プロジェクト: madig/trufont
 def hasOverlap(self):
     bGlyph = BooleanGlyph()
     pen = bGlyph.getPointPen()
     openContours = 0
     for contour in self:
         if not contour.open:
             contour.drawPoints(pen)
         else:
             openContours += 1
     bGlyph.removeOverlap()
     return len(bGlyph.contours) + openContours != len(self)
コード例 #2
0
 def hasOverlap(self):
     bGlyph = BooleanGlyph()
     pen = bGlyph.getPointPen()
     openContours = 0
     for contour in self:
         if not contour.open:
             contour.drawPoints(pen)
         else:
             openContours += 1
     bGlyph.removeOverlap()
     return len(bGlyph.contours) + openContours != len(self)
コード例 #3
0
ファイル: defcon.py プロジェクト: madig/trufont
    def removeOverlap(self):
        # TODO: maybe clear undo stack if no changes
        self.prepareUndo()
        bGlyph = BooleanGlyph()
        pen = bGlyph.getPointPen()
        for contour in list(self):
            if not contour.open:
                contour.drawPoints(pen)
                self.removeContour(contour)
            else:
                contour.selected = False
        bGlyph = bGlyph.removeOverlap()
        pen = self.getPointPen()
        for contour in bGlyph.contours:
            contour.drawPoints(pen)

        self.dirty = True
コード例 #4
0
    def removeOverlap(self):
        # TODO: maybe clear undo stack if no changes
        self.prepareUndo()
        bGlyph = BooleanGlyph()
        pen = bGlyph.getPointPen()
        for contour in list(self):
            if not contour.open:
                contour.drawPoints(pen)
                self.removeContour(contour)
            else:
                contour.selected = False
        bGlyph = bGlyph.removeOverlap()
        pen = self.getPointPen()
        for contour in bGlyph.contours:
            contour.drawPoints(pen)

        self.dirty = True