Closed madig closed 6 years ago
@madig, probably need re-checking after merging of daltonmaag/ubuntu/pull/20
Couldn't figure out yet how to better implement the rules so that ufonormalizer is only called on UFOs that changed and concurrency is possible...
It's slightly hard, because ufonormalize
because the files are being modified in-place.
Normally with a Makefile, there is some output file, which is recreated using when the input files further down the chain are found to be newer than the output file (comparison of timestamps). With only one file, you cannot compare it to itself.
Possible solutions, other other .PHONY
rule that doesn't produce any outputs, but which does run through the motions of "compiling" the .ufo
s that are newer than some timestamped output file.
The second, for manually invocation would be to use the output of git status directory/*.ufo
.
fwiw, ufonormalizer also has an -o option
Why do you also need to normalize the ufos when you just want to build ttfs from them? If it’s just normalisation, then the ufo’s content and thus the ttf output won’t change after that. I believe it should be a separate phony target, or a pre-commit hook. I’ll try to find some time to refactor the ufonormalizer to work as a git pre-commit hook (it needs to return the right exit code and allow to normalise single files inside the ufo).
Including them in the compilation step prevents forgetting about it. But sure, I'll wait for your refactor :)
you know you could simply open all UFOs with defcon (or Trufont which subclasses defcon) and re-save them back, and you would get them "normalized" in the sense of "written out as ufoLib (aka the reference implementation) writes UFOs"... Then you won't need any ufonormalizer step -- of course, as long as you only edit those UFOs using tools that use ufoLib as the writer.
just sayin'
this is just to say that ufo normalization is not such a huge priority for me right now. I don't care too much if my xml has spaces vs tabs.
Other editors might format the XML differently, so it needs to be an external tool. The defcon idea is clever, but since we're already using ufonormalizer, switching will just lead to huge commit churn.
We should only normalize with make normalize
.
It will simply normalize all UFOs.