Skip to content

Instantly share code, notes, and snippets.

@weiweihuanghuang
Created June 11, 2021 03:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weiweihuanghuang/e8d12e9cb9d58205f8758a6354753b3b to your computer and use it in GitHub Desktop.
Save weiweihuanghuang/e8d12e9cb9d58205f8758a6354753b3b to your computer and use it in GitHub Desktop.
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