[Scripting] Change glyph.export statement

Something don’t work normally for me with this following script no matter which glyph file.

font = Glyphs.font
glyphName = []
for glyph in font.glyphs:
	glyphName.append(glyph.name)
	glyph.export = False
print(glyphName)

I need to run it several time to switch all glyph.export to False.
Whereas turning all glyph.export to True work in one run.

How do you check? Perhaps just the UI slow to react?

I see that directly in the FontView, it’s not a lag or UI slow refresh.

That is also UI, isn’t it.

Try wrapping your code in this:

Font.disableUpdateInterface()
# your code here
Font.enableUpdateInterface()

It disables and re-enables UI updates in Font View. Good idea to do that because non-exporting glyphs may be reordered when the Font View is active. Makes your script faster too.

1 Like

Perfect, thanks !