Commit Graph

27 Commits (2afcb05d169428d77743f6a4dac639286ad905e2)

Author SHA1 Message Date
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 e5146fcecb Avoid duplicate names in glyphorder table.
When adding a single glyph that was not in the cmap, this was adding the
name for that glyph twice.
2017-02-16 15:07:47 -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 58097d9d4c Generate reversed GSUB sequences for subregion flags too.
Since subregion flag sequences consist of BN and ON they can be
impacted by bidi, and once again we have the problem that these are
processed in visual order so we need GSUB rules such that we can
handle them in either direction.  All subregion flag sequences
contain U+E007F, so we use that as a trigger for adding the
reversed sequence.

We also need to handle emitting the missing flag glyph for the
reversed sequences.

And we also want to strip out tag glyphs when the context is reversed.
This means the chaining context should include 'E007F' as well.
2017-02-15 16:21:55 -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 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 763a0f5155 Add subregion flag resources from upstream. 2017-01-25 09:39:33 -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 be1ec4f152 Update handling of fitzpatrick modifiers.
To handle forming emoji 'ligatures' in RTL contexts we generate
reversed ligature sequences for the GSUB table.  Formerly we only did
this when there was a ZWJ in the sequence, and full reversal worked
because we had no sequences with both fitzpatrick modifiers and ZWJ.
However, now we do.  Harfbuzz treats fitzpatrick modifiers as though
they were combining marks and so we need to as well so that GSUB data
is in the order Harfbuzz expects.  So we 'unreverse' these pairs.
2016-07-11 11:31:51 -07:00
Doug Felt 04bde33598 Update IC flag from upstream.
The .svg had already been updated, must have missed the .png.  The new
image is the civil flag.
2016-04-27 13:00:47 -07:00
Doug Felt ae285e5838 Use delete_from_cmap from nototools in emoji_builder. 2016-04-04 13:59:59 -07:00
Doug Felt cc4c77ada3 Fix some Android emoji issues.
- Remove PUA character for 'unknown flag' from cmap.
  Unfortunately, the contorted build process means we can't do this where
  we do our other cmap munging-- font.getGlyphID dies in emoji_builder
  if we remove it from the cmap in add_glyphs.py.  So we remove it at
  the end of emoji_builder.
- Forgot to remap one territory flag, missed it in the spreadsheet.  Also
  corrected a typo where I remapped the same flag twice.  Sorted the flags
  in key alpha order.
2016-04-01 15:12:35 -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 0b5cf8651b Add IC svg and png resources from upstream (behdad/region_flags). 2016-03-11 15:16:54 -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 c67a8c3fa6 small fixes 2015-11-13 18:15:09 -08:00
Doug Felt 170bcdad0e comment out some print lines used for debugging 2015-11-13 17:34:15 -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 6bd9cc4a9b Remove format 14 cmap tool and ucd data, and update Makefile
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.
2015-10-14 16:56:44 -07:00
Doug Felt 5aad55c383 Add tool and data to generate format 14 cmap.
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.
2015-10-13 18:16:04 -07:00
Doug Felt 3f36ea9b16 fix for review 2015-09-29 12:46:17 -07:00
Doug Felt baad14e5aa fix add_glyphs to use absolute path when extending sys.path 2015-09-29 11:34:28 -07:00
Khaled Hosny 0955c3cddc Python is not always installed as /usr/bin/python 2015-06-19 22:01:52 +02:00
Khaled Hosny e58a66978a Fix build
Fix the paths after repo split.
2015-06-19 22:01:26 +02:00
Behdad Esfahbod 1242c91dbf Move emoji-specific third-party and scripts into color_emoji/
In prep for repo split.
2015-06-05 10:58:41 -07:00