Change the build process to provide more intermediate steps and maintain
intermediate targets. This slows down make's analysis phase, though.
Make can be run with -j to parallelize the building, but be careful
with multiple targets on the command line (e.g. 'make clean font') since
clean's deletion of the output tree can sometimes occur after some of
the output directories get built.
This is preparatory to replacing the png images with the original internal
set. These require a bit more cleanup and processing, which is what these
changes do. The overall flow is:
- convert all emoji to desired size (136x128). All are smaller than this,
most are 128x128 but there are some others.
- run waveflag on the flags
- convert all flags to desired size(136x128). The flags are 128x128
originally.
- 'rename' the flags by creating softlinks with the desired names
- run pngquant on all the images and copy them into a single directory,
this reduces slight antialiasing differences.
- compress all the images, using zopflipng if available, else optipng.
zopflipng saves about 10%, but is 10x slower.
The remaining steps of building the font are unchanged, for the moment.
The intermediate image files are put into a 'build' subdirectory to organize
them and keep them out of the way.
Another way to do this is to create a target, but when I tried that
it reintroduced the dependency analysis problem-- rules with this
dependency always triggered. Of course I might have missed something
subtle. Both the target approach and this approach come from
http://stackoverflow.com/questions/5618615/check-if-a-program-exists-from-a-makefile)
This always runs, but unless you're just running clean you'd always want to
perform this check, so I think that's ok.
This reverts some changes in commit b257b6647d that were causing build
issues. Those changes quoted the path to pngquant in order to deal
with spaces in the path, but as a side effect that prevented
build-dependency analysis (gnu 3.81 on ubuntu) from recognizing that
the .png files didn't need to be built, and so rebuilt them every
time, which takes several minutes. Apparently make doesn't like
quotes-- strings passed to the shell are fine, but things make itself
processes (like names of targets) are treated literally.
Since the path to pngquant is (now, anyway) a local subpath of the
current directory that has no spaces, it should be ok to use the
subpath and not bother to quote.
Another change replaces two dependencies on flag-symlinks with a
dependency on PNG128_FLAGS, for the same reason: after flag-symlinks
executed it was not recognized as being up to date and so the rules
with these dependencies always executed.
The tool and data was moved to nototools.
Makefile now needs to invoke the tool as a script, rather than passing
it to python, since the tool is no longer local. Running setup.py in
nototools will make the script accessible. Setup (apparently) copies
the script to /usr/local/bin and it is not automatically updated when
nototools changes, still need to figure out how to address this.
emoji-data and the code to process it might be useful, but it not
actually used by the tool at present.
The tool currently assumes that all emoji glyphs mapped by the default
cmap share the same presentation.
This script takes ~1 second for startup, so calling it repeatedly for
each flag slows the Makefile considerably, and unnecessarily since it
can be called for all the flags at once.
Now make clean takes about 1.2s, instead of 3m45s.