Glyphs.font.currentTab.layers broken?

here’s what I get:

Traceback (most recent call last):
  File "<string>", line 174, in <module>
  File "GlyphsApp/", line 124, in __repr__
  File "GlyphsApp/", line 140, in __iter__
  File "GlyphsApp/", line 7295, in values
  File "GlyphsApp/", line 7257, in deactivateFeatures
NameError: global name 'copy' is not defined

I noticed this a few cutting edge versions ago, but have been busy and didn’t get around to reporting it. I compared the GlyphsApp to a previous version and use of copy was added, but there’s no import copy. To work around for the moment I just added to my scripts:

import copy import GlyphsApp GlyphsApp.copy = copy

1 Like

I fixed the import.

I’m not sure the current implementation is what I would expect (I didn’t implement it). tab.layers returns a list of the layers that you have typed. It does not change if you activate features. What do you think?

1 Like

Thanks @zakkuri and @GeorgSeifert!

Well, that’s a tricky question, Georg. I can imagine that returning the actual layers might be more logical in some cases. On the other hand: for the potential use I can think of just now it’s already fine with the typed layers. It would not return all the layers in cases like when you hit that Show All Masters command as well?

Can I ask what’s the function that applies the features in a tab?

I think you can use these on the tab:

.selectedFeatures().append(featureTag) and/or .selectedFeatures().addObject_(featureTag)

Thank you! I phrased it poorly, I mean I’d like to get the changed list of layers/glyphs after features applied :slight_smile:

Then Font.currentTab.allLayers() will show the “changed” or “feature-applied” layers

1 Like

Perfect, thank you!

1 Like