glyphOrder based on Label Color

Hey !

I’m writing a script to generate glyphOrder to display glyph by Label Color.
I was wondering if there will be a secret/hack technique to do this dynamically.
Actually if a change a Label Color, I need to run script again to refresh glyphOrder.

There is a hack. But it will only sort, not do the grouping. And it will be very temporary. So a lot of things done with the font view will reset it.

from AppKit import NSSortDescriptor
sortdescriptor = NSSortDescriptor.sortDescriptorWithKey_ascending_("colorIndex", True)
Font.fontView.glyphsArrayController().setSortDescriptors_([sortdescriptor])
1 Like

If like me, you are obsessed with Layer Color, I did a script to filter them in FontView.

It would be awesome if it was possible to do that natively in Glyphs :wink:
And that the filtering is dynamic :upside_down_face:

I found an extra hack :
Just trigger the script when the user is in FontView and changes Selected Master and TA DA ! , it’s dynamic.