I'm trying to write a simple python script that acts on the glyphs that the user has selected in the FontLab font window:
I'm especially interested in the glyphs (or maybe more accurately "glyph slots") that are in the encoding but are un-filled.
So far I've tried two things:
# 1 - glyph slots
selectedSlots = fl.count_selected
print "Number of selected glyph slots:", selectedSlots
# 2 - selected glyph names
selectedNames = [ fl.font.glyphs[i].name for i in range(len(fl.font.glyphs)) if fl.Selected(i) ]
print "List of selected glyph names:", selectedNames
Script number 1 reports a count of the full user selection - all selected glyph slots - filled and un-filled - perfect! Script number 2 returns a list of glyphnames but only the selected glyphs that are filled - no good. Results of running 1 and 2:
Number of selected glyph slots: 3
List of selected glyph names: ['eacute']
Can anyone suggest a technique that will list the glyphnames associated with all the selected glyph slots?