Hi everyone!
I’m practicing trying to create a script that compares the glyph set of two open fonts and trough a button allows to add glyphs to fonts.
Here my questions.
When I add a glyph it only creates the glyph but not filled with the components in the case of accented glyphs. I want to achieve the smart behavior of Glyphs. Is this possible?
I don’t know how to update the list after adding items, I’ve tried with self.w.myList.remove but after this, for instance, I get “out of range” errors.
I think is more easy to understand and find errors looking to the code. Here the script and a screenshot.
Thanks! I’ve been trying to implement this but without success yet.
I don’t know why myLayer.makeComponents() works only for one master.
This is what Im doing in the button callback function. What im doing wrong?
def button2Callback1(self, sender):
seleccion = self.w.myList2.getSelection()
for i in seleccion:
name = self.w.myList2[i]
font1.glyphs.append(GSGlyph(name))
for layer in font1.glyphs[name].layers:
layer.makeComponents()
Im following your suggestion for my other question, creating a function for building the list but I don’t know how to reuse it after clicking the button. I need to improve my python skills. back to Codecademy!! haha.
Well, I’ve tried what you say and and finally I managed to call the function that build the lists when I hit the button, thanks!
The lists are updated but for some reason the UI list is not updated.
Could you help me pointing me what I’m doing wrong?
Thanks for all the help you gave me.
I have a question related to the myLayer.makeComponents() function.
When the glyph is added to the font and later I run the function of makeComponentes, it only works for one layer because until I enter to the added glyph or switch masters, the layers for other masters are not created. There is a way to “enter” the glyph with the code.