New Glyphs filter - doesn't appear in menu - filter()


#1

Making first steps in converting a script to a Glyphs filter using the SDK. It’s exciting… but so far it’s not even appearing in the menu after installation!

I’ve used the github ‘Filter with Dialog’ virgin files and added in my the vanilla window code per instructions as well as my other functions. I believe the names are correctly set.

I will still need to adjust the code to take the filter() function in to account but I would have thought this was enough to load up the UI so I can begin to test and adjust the code?

Also - a little confused by the filter() function and the presence of the layer argument. Does this mean if I want to process multiple glyphs I should call filter() for each glyph(layer) or should I do it all inside filter()? It also doesn’t seem to be bound to any user action in the sample code (except on export)?


#2

Just a few quick notes.

Check the console app for errors.

And you don’t call the filter() method yourself. You just need to implement it.


#3

Aha… a new rabbit hole!

The principle class “AngularizzleClass” is set. Also named in the plist. What does this mean exactly? There is an error somewhere in plugin.py?

(I removed the nib and xib files)


#4

I worked backwards from the super simple vanilla sample. (https://github.com/schriftgestalt/GlyphsSDK/tree/master/Python%20Templates/Filter%20with%20Dialog#use-vanilla-for-the-dialog-view)

That sample was working and I can add new vanilla TextBox’s fine. As soon as I add in a CheckBox or EditText it’s not in the filter menu any more / won’t load. Pretty much impossible for me to know what’s going on without a macro panel style error. Any more clues?

self.name = 'My Select Tool'
# Create Vanilla window and group with controls
width = 500
height = 500
self.paletteView = Window((width, height))
self.paletteView.group = Group((0, 0, width, height))

self.paletteView.group.text = TextBox((10, 10, -10, 20), 'x/y shift')
self.paletteView.group.titlesize = TextBox((20, 20, -10, 17), "Min2222 plane:")
self.paletteView.group.titlesize2 = TextBox((200, 200, -10, 17), "ello plane:")
#self.paletteView.group.checkBox = CheckBox((20, 50, -10, 17), "Keep detail", value=True)

#5

The particular problem in the plugin you send above is a mix of tabs and spaces. You should find an error message in the macro window.


#6

Mother Mary! Always. Something. Simple.

Thanks for your patience Georg.


#7

Just putting this here for any one else:

Sublime text has a great little feature that converts spaces to tabs, or vice versa. Helps when mixing and matching chunks of code.


#8

The most important thing is to always display nonprinting chars.


#9

Ah even better… for sublime: