Force a refresh

I have several fonts which currently have automatic alignment disabled. I have noticed that when I uncheck that box (thus turning auto alignment on) that I need to actually scroll through each glyph in each layer to cause any changes to refresh and to update the lastChange() value. Is there a way I can trigger GlyphsApp to ‘look’ at each glyph and update based on the current autoalignment setting via a script, or do I need to just scroll through everything in all masters?

Could this be a UI glitch? Does closing and opening the document take care of this?

No, that doesn’t address it. I just opened a font, modified the .notdef to update it’s lastChange date. Then I unchecked the “disable automatic alignment” box and ran this script:

font = Glyphs.font
for glyph in font.glyphs:
if glyph.lastChange() > font.glyphs[’.notdef’].lastChange():
print glyph.name, glyph.lastChange()
print(‘done’)

It listed all the currently visible glyphs which had changed. I then quit and restarted Glyphs, and re-ran the same script. I get the same list of glyphs.

THEN I scroll through the whole font in the current master, rerun the script and see many more glyphs that have been update. Each time I do this in a master, I uncover more glyphs which need to be redrawn because of the alignment change.

So I think I’ve shown pretty conclusively that I need to force a redraw to update the lastChange value. I’d love a way to make this happen more easily than scrolling through these fonts again and again and again. I know this is a situation we will encounter again as we update fonts that started out with auto alignment disabled.

The auto alignment is not done for all glyphs immediately. But it is done on redraw of the glyph or on export.

Thanks. That confirms what I’ve witnessed. So is there a way I can force the redrawing? Could I loop through all glyphs in all layers and do something like draw offscreen just to see if it results in a change?

You can run alignComponents() on all layers.

I’ve just noticed recently that viewing the glyphs in the font view and scrolling from top to bottom triggers redrawing (and aligning) for each master. It would be nice if this was done all at once at the moment auto alignment is enabled.

1 Like