tooling: Adds glyphs script for selecting empty glyphs
This commit is contained in:
parent
e1bcfbfde2
commit
a7d65d5d5f
1 changed files with 18 additions and 0 deletions
18
misc/glyphs-scripts/select-empty-glyphs.py
Normal file
18
misc/glyphs-scripts/select-empty-glyphs.py
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
#
|
||||||
|
# Selects all glyphs which are empty
|
||||||
|
#
|
||||||
|
import sys
|
||||||
|
|
||||||
|
def isEmpty(g):
|
||||||
|
for master in g.parent.masters:
|
||||||
|
layer = g.layers[master.id]
|
||||||
|
if layer.bounds is not None and layer.bounds.size.width > 0:
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
|
font = Glyphs.font
|
||||||
|
font.disableUpdateInterface()
|
||||||
|
try:
|
||||||
|
font.selection = [g for g in font.glyphs if isEmpty(g)]
|
||||||
|
finally:
|
||||||
|
font.enableUpdateInterface()
|
||||||
Reference in a new issue