Commit Graph

67 Commits (3c031c3dbafa4618706449f384490c5c5be0daba)

Author SHA1 Message Date
Roel Nieskens 385846bb4f Add glyf table on the fly
Instead of using a separate template, add_glyphs.py will add a
`glyf` and `loca` table when requested via a flag.
2020-11-04 11:36:01 +01:00
Roel Nieskens 6c222b5917 Add cmap format 4 3/1 table for Windows compatibility 2020-11-02 14:26:54 +01:00
Roel Nieskens d453af82c9 Output Windows compatible font with glyf + loca table 2020-11-02 14:26:15 +01:00
guidotheelen c679409f9b use second argument for emoji_builder 2020-08-10 14:25:13 +02:00
guidotheelen 4f41aa7c55 use names from makefile as input 2020-08-07 14:43:53 +02:00
Guido Theelen bebb2f2b39
Merge branch 'master' into feature/fontlinter 2020-06-16 08:22:41 +02:00
rsheeter 4fddbebe7b missing a spot 2020-05-31 12:07:55 -07:00
rsheeter 97f95d0d69 tweak check for tools & venv 2020-05-31 12:05:29 -07:00
Rod S d113757604 correct apt-get sample 2020-05-30 14:51:53 -07:00
rsheeter 0553e8fb9b no reason to display using zopflipng if it is the only choice 2020-05-30 14:22:47 -07:00
rsheeter 48c935347a only zopflipng 2020-05-30 14:11:54 -07:00
guidotheelen db01fa994a add exception when not in virtual env 2020-05-07 13:25:10 +02:00
guidotheelen 015aa0267b always run sequence checks or bypass 2020-05-06 12:03:09 +02:00
guidotheelen ed33b0c479 remove y/n prompt 2020-05-06 10:09:58 +02:00
guidotheelen fcae5b1693 rename SEQUENCE_CHECK_PY 2020-05-06 09:19:25 +02:00
guidotheelen 2c4d088209 brief question 2020-04-22 09:57:20 +02:00
guidotheelen 22a6f51174 remove comment 2020-04-22 09:46:53 +02:00
guidotheelen 51137aa773 add coverage check to make 2020-04-22 09:45:14 +02:00
guidotheelen ac9a6397f7 readme prerequisites 2020-04-14 16:56:16 +02:00
guidotheelen f4cb46a8e5 initial fontchain linting 2020-04-08 15:40:14 +02:00
Cosimo Lupo 3d5ac2aea9
Makefile: define PYTHON=python3 make variable 2019-10-21 15:58:06 +01:00
Mike FABIAN 188ffcf08c Use Python3 explicitly 2019-07-17 10:35:02 +02:00
Qingqing Deng 44f3e5b7f2 Region flags change.
Add flags for
BL: Saint Barthélemy
BQ: Caribbean Netherlands
MQ: Martinique
RE: Réunion
TF: French Southern Territories

Change flag for
XK: Kosovo
2019-07-02 12:32:10 -07:00
Doug Felt a429c1b748 Depend on installed pngquant, not our copy 2019-03-16 16:28:22 -07:00
Doug Felt e571d53e02 Some tooling updates for android u11.
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
2018-05-09 20:13:57 -07:00
Peter Oliver f88164ac0a Make it easier to assemble images of other sizes
Until https://github.com/googlei18n/noto-emoji/issues/9 arrives, this will make it slightly more convenient to use this `Makefile` to build Twemoji, which uses 72 × 72 pixel PNGs.
2017-11-17 16:09:53 +00:00
Doug Felt fe67fac240 Use quality param with optipng.
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.
2017-04-12 09:00:01 -07:00
Doug Felt 2afcb05d16 Quiet makefile output. 2017-04-12 08:59:16 -07:00
Doug Felt ee81bf8043 Fix resize of grayscale images.
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.
2017-04-12 08:53:18 -07:00
Doug Felt 616ed3a600 Rewrite add_glyphs, use alias table.
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.
2017-02-21 10:15:08 -08:00
Doug Felt a62c0be851 Add GSUB substitutions to provide unknown flag for pairs of RIS.
A current issue in Harfbuzz requires that you not perform a delete
on index 1 before running a lookup on index 0.
2017-02-15 16:33:03 -08:00
Doug Felt d270ecad99 Generate unknown flag for unrecognized subregion emoji sequences.
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.
2017-02-15 16:21:55 -08:00
Doug Felt b5c7e8035c Use waving black flag for subregion flag sequences.
This was a recent change from the UTC.
2017-02-15 16:21:54 -08:00
Doug Felt 57ec57dfd6 Support subregion flags when building the emoji font.
- 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.
2017-01-25 16:57:37 -08:00
Doug Felt 494fb41a68 Copy original file if pngquant can't compress it.
--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.
2017-01-25 09:16:47 -08:00
Doug Felt 11868c62b7 Fix location of new flag resources, and also update Makefile. 2017-01-24 14:27:29 -08:00
Doug Felt 41fa8181f5 Update for new waveflag semantics.
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.
2016-10-07 14:31:12 -07:00
Doug Felt 741f8b92c9 Update waveflag.c to upstream version.
Also updates LDFLAGS to match upstream.
2016-10-07 14:21:32 -07:00
Doug Felt e16b39e492 Bump version, specify additional chars in varsel cmap.
The additional variation chars option makes it easier to build prototype
versions of the emoji font.
2016-07-13 11:36:25 -07:00
Doug Felt 343e9ffbf4 Add 'unknown flag' glyph.
This uses PUA character U+FE82B for the unknown flag during processing.
Currently I don't yet remove this from the cmap when we're done.
2016-03-13 14:56:02 -07:00
Doug Felt 3a57df2ac6 Improve flag support.
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.
2016-03-11 19:02:15 -08:00
Doug Felt 6caa07aaae Minor tweaks to quiet makefile and fix bug in add_glyphs. 2016-01-28 14:03:21 -08:00
Doug Felt fc0ab7f36d Update NotoColorEmoji template so that it passes lint, bump version.
- 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
2015-11-30 17:49:52 -08:00
Doug Felt c67a8c3fa6 small fixes 2015-11-13 18:15:09 -08:00
Doug Felt ed31eb2a9f fix emoji source path 2015-11-13 17:57:17 -08:00
Doug Felt 34fbef4348 Rewrite makefile
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.
2015-11-13 17:35:50 -08:00
Doug Felt d9e320acb5 updates to support tr51 emoji sequences 2015-11-05 11:15:15 -08:00
Doug Felt 0f227e7834 wip - update emoji tooling to support tr51 sequences 2015-11-03 18:40:19 -08:00
Doug Felt deff1a6545 Reintroduce check for missing binary, using a different method.
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.
2015-10-14 17:43:18 -07:00
Doug Felt 4a90607d2d Remove VS_ADDER as a dependency since it is not local 2015-10-14 17:26:44 -07:00