Note this does not change image files.
- modify emoji_builder so we can use a flag to control whether to use
big or small glyph metrics. android has legacy tooling that expects
small metrics. we leave the default in emoji_builder to use big metrics
but in the makefile default the flag we pass to request small metrics.
eventually this should shake out to big metrics.
- support more flags by default (not all yet). Note we omit some in the
Makefile that we use aliases for-- we don't need their images.
- add aliases for some new flags
- remove new flags from 'unknown flag aliases' list
- unalias some emoji we will have custom images for
- bump version number
- add annnotations file for u11 new and changed emoji
When images are not processed due to not being able to meet the
minimum quality setting, error 99 is returned, so catch this too
so we still copy the file.
Might still want to tweak these settings.
When imagemagick 6.7.7-10 is processing the '-extent' operator and
discovers an image is grayscale, it turns the 32-bit truecolor sRGB
image into a grayscale image, but does so incorrectly-- the gray
levels and alpha are wrong. Get around this by using composition
to copy the source image over a slightly larger transparent image.
This is a rewrite of add_glyphs in third_party/color_emoji. The
primary motivation was to move special aliasing rules out of that
code and use an external aliases file instead. This new version
is a bit more thorough about aliasing, and hopefully a little
easier to read.
The new add_glyphs takes its parameters using keywords, so
the invocation in the Makefile changed (as well as the path to
the tool).
emoji_aliases.txt was extended to add the flag aliases that were
formerly defined in the old add_glyphs code.
add_aliases was modified so the name of the alias file could be
passed in as a parameter to the main utility function that reads
the alias mapping from the file.
The new code expects all glyphs used by the template GSUB tables
to be named in the GlyphOrder table, but doesn't require the cmap
and hmtx table to be fleshed out. The new code fleshes these out
when it processes the sequences to add. As a result the cmap and
hmtx tables in the template were truncated.
The new code also sorts the GlyphOrder table when it extends/rebuilds
it.
Instead of writing code to build the additional lookups needed for
subregion missing flag handling, this adds a GSUB table to the
template and lets add_glyphs do its normal thing to the first
GSUB lookup.
- update Makefile to include approved GB subregion flags by default
- update flag_glyph_name to generate sequence names for these
- fix bug where the glyphorder table wasn't getting updated with
components, which was causing ttx to fail when compiling the
ttx to ttf in a later phase.
--skip_if_larger does nothing and returns an error if pngquant would
generate a larger file than the original. Formerly we would not copy
the file in this case so later operations expecting the file would fail.
No image triggered this, though, so the issue went unnoticed. We want
the smaller of the two files. It's unclear if later compression using
optipng would still do better with the larger quantized file vs the
original unquantized file, but we need to have a file.
Previously our copy of waveflag took just an input and output filename.
Upstream takes a prefix and one or more input filenames, and concatenates
the prefix to the input filename as the output.
The makefile is changed to pass a prefix and the input filename, instead
of the input filename and the output filename as it formerly did.
Unfortunately for us, our inputs have a directory prefix since they're
not in the current directory, and we don't want this prefix in the output
file path. So we tweak our copy of waveflag.c to call basename on the
input file path before we append it to the prefix.
We also make the tool a little less noisy by putting more printfs
under the debug flag.
This adds some additional flags to the default set. In addition,
it contains code that creates ligatures for some flag sequences to
others, for a few cases where we want different regions to share
the same flag. Finally, it adds default ligatures so that pairs of
regional indicator characters for which there's no predefined glyph
get a 'missing flag' glyph. This avoids cases where sequences of
regional indicator sequences accidentally match at odd locations
because of a previous mismatch.
There is no actual 'missing flag' glyph yet. The code uses an
existing emoji as a placeholder.
- fix ascent/descent in hhea and os/2 to match noto UI expectations,
zero linegap, clear useTypoMetrics bit, set weight to regular (400).
- add missing entries to name table, update revision
- map U+0000 to null glyph (not .notdef)
In addition, this tweaks the Makefile in some small ways:
- quiet zopflipng output somewhat (listen to your cpu fan to know
that something's happening) :-)
- make flag-symlinks target an order-only dependency (it was triggering
quantize+compress even when images hadn't changed)
- add comment about how to bypass make bug if multithread hangs
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.
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.
The bitmap emoji tools are extended to create GSUB rules for character
sequences. The images are renamed to code the character sequence in their
filenames. New images are created for ASCII digits and number sign. A new
script is added to add cmaps to the files for backward compatibility.