Last active
December 6, 2015 21:20
-
-
Save weiweihuanghuang/7853f5464e4a150e7176 to your computer and use it in GitHub Desktop.
Show Glyphs with this Anchor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#MenuTitle: Show Glyphs with this Anchor | |
# -*- coding: utf-8 -*- | |
__doc__=""" | |
New Tab with all Glyphs that are have the selected anchor. | |
""" | |
thisFont = Glyphs.font # frontmost font | |
selectedLayer = thisFont.selectedLayers[0] | |
selection = selectedLayer.selection | |
editString = "" | |
for anchor in selection: | |
anchorName = anchor.name | |
for glyph in thisFont.glyphs: | |
thisLayer = glyph.layers[thisFont.selectedFontMaster.id] | |
if len(thisLayer.anchors) > 0: | |
for eachAnchor in thisLayer.anchors: | |
if eachAnchor.name == anchorName: | |
editString += "/%s" % thisLayer.parent.name | |
break | |
editString += "\n\n" | |
thisFont.newTab(editString) ### Open Tab with all Characters |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
improved the script a bit: https://gist.github.com/schriftgestalt/df1d24c523b1aeb270e5