googlefonts / gftools

Misc tools for working with the Google Fonts library
Apache License 2.0
242 stars 71 forks source link

[Builder] `instance_ufos` directory not always replaced/updated during new build, even if sources have changed #998

Open arrowtype opened 2 months ago

arrowtype commented 2 months ago

This is a comment in https://github.com/googlefonts/gftools/issues/875, but I figure it may be a separate issue. Feel free to close this issue if it really is duplicate, though.

That issue, I think, is more about cleaning up files after a build. By contrast, I could imagine there being a reason to keep instance_ufos around, even after a build, to speed up future builds... but my real issue is that it isn’t always updated or replaced when I change something in UFO sources, then build again.

As a specific example: I ran a build on a family, with a UPM of 1000. It had a small "body size," just due to the way glyphs were drawn. I wanted to test how changing the UPM to 512 (with no outline scaling) would affect the rendered body size. I made the change in the font info.plists of the source UFOs, then ran a new build, and... there was no change in the built fonts. But, when I specifically deleted the instance_ufos directory and ran a build again, the UPM edit had the expected result (i.e. the body size increased).

This is just one specific example, but I’ve run into this many times, where edits don’t make it into the built fonts, due to a persistent instance_ufos directory. A colleague reported having similar experiences.

As a workaround, I’ve added a build step to my process which deletes that directory if it exists already, before running the GF builder. Of course, it would be much nicer if the builder did this by default, as this is an easy but confusing issue to run into.

Thanks!