Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
removeExternalOverlaps.py
#MenuTitle: Remove External Overlaps
# -*- coding: utf-8 -*-
__doc__="""
Removes external overlaps for selected Glyphs
"""
import GlyphsApp
from GlyphsApp import GSPathPen
ListOfSelectedGlyphs = [ l for l in Font.selectedLayers if hasattr(l.parent, 'name')]
for thisLayer in ListOfSelectedGlyphs:
layerPaths = [l for l in thisLayer.paths]
for l in thisLayer.paths:
del(l)
for eachPath in layerPaths:
pen = GSPathPen.alloc().init()
eachPath.drawInPen_(pen)
eachPath = pen.layer().paths
thisLayer.addPath_(eachPath[0])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment