예제 #1
0
def removeGlyphOverlap(glyph):
    """Remove overlaps in contours from a glyph."""
    #TODO(jamesgk) verify overlaps exist first, as per library's recommendation
    manager = BooleanOperationManager()
    contours = glyph.contours
    glyph.clearContours()
    manager.union(contours, glyph.getPointPen())
예제 #2
0
    def remove_overlaps(self, ufo):
        """Remove overlaps in a UFO's glyphs' contours."""

        for glyph in ufo:
            manager = BooleanOperationManager()
            contours = glyph.contours
            glyph.clearContours()
            manager.union(contours, glyph.getPointPen())
예제 #3
0
    def remove_overlaps(self, ufos):
        """Remove overlaps in UFOs' glyphs' contours."""

        manager = BooleanOperationManager()
        for ufo in ufos:
            print('>> Removing overlaps for ' + self._font_name(ufo))
            for glyph in ufo:
                contours = list(glyph)
                glyph.clearContours()
                manager.union(contours, glyph.getPointPen())
예제 #4
0
 def removeOverlap(self):
     """Removes overlap by combining overlapping contours. Not really necessary,
     but some font rendering systems need this."""
     manager = BooleanOperationManager()
     for glyph in self.UFO:
         contours = list(glyph)
         glyph.clearContours()
         try:
             manager.union(contours, glyph.getPointPen())
         except:
             m = 1