mirror of
https://github.com/googlefonts/noto-emoji.git
synced 2025-06-08 07:47:59 +00:00
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.
This commit is contained in:
parent
2ecfab517e
commit
cc4c77ada3
2 changed files with 22 additions and 2 deletions
4
third_party/color_emoji/add_glyphs.py
vendored
4
third_party/color_emoji/add_glyphs.py
vendored
|
@ -85,9 +85,9 @@ EXTRA_SEQUENCES = {
|
||||||
# Flag aliases - from: to
|
# Flag aliases - from: to
|
||||||
FLAG_ALIASES = {
|
FLAG_ALIASES = {
|
||||||
'BV': 'NO',
|
'BV': 'NO',
|
||||||
'SJ': 'NO',
|
'CP': 'FR',
|
||||||
'UM': 'FR',
|
|
||||||
'HM': 'AU',
|
'HM': 'AU',
|
||||||
|
'SJ': 'NO',
|
||||||
'UM': 'US',
|
'UM': 'US',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
20
third_party/color_emoji/emoji_builder.py
vendored
20
third_party/color_emoji/emoji_builder.py
vendored
|
@ -353,6 +353,21 @@ class CBLC:
|
||||||
self.pop_stream ()
|
self.pop_stream ()
|
||||||
|
|
||||||
|
|
||||||
|
# copied from nototools/font_data
|
||||||
|
_UNICODE_CMAPS = {(4, 0, 3), (4, 3, 1), (12, 3, 10)}
|
||||||
|
|
||||||
|
def delete_from_cmap(font, chars):
|
||||||
|
"""Delete all characters in a list from the cmap tables of a font."""
|
||||||
|
cmap_table = font['cmap']
|
||||||
|
for table in cmap_table.tables:
|
||||||
|
table_tup = (table.format, table.platformID, table.platEncID)
|
||||||
|
if table_tup in _UNICODE_CMAPS:
|
||||||
|
for char in chars:
|
||||||
|
if char in table.cmap:
|
||||||
|
print 'removing %04x from %s' % (char, table_tup)
|
||||||
|
del table.cmap[char]
|
||||||
|
|
||||||
|
|
||||||
def main (argv):
|
def main (argv):
|
||||||
import glob
|
import glob
|
||||||
from fontTools import ttx, ttLib
|
from fontTools import ttx, ttLib
|
||||||
|
@ -527,6 +542,11 @@ By default they are dropped.
|
||||||
drop_outline_tables (font)
|
drop_outline_tables (font)
|
||||||
print "Dropped outline ('glyf', 'CFF ') and related tables."
|
print "Dropped outline ('glyf', 'CFF ') and related tables."
|
||||||
|
|
||||||
|
# hack removal of cmap pua entry for unknown flag glyph. If we try to
|
||||||
|
# remove it earlier, getGlyphID dies. Need to restructure all of this
|
||||||
|
# code.
|
||||||
|
delete_from_cmap(font, [0xfe82b])
|
||||||
|
|
||||||
font.save (out_file)
|
font.save (out_file)
|
||||||
print "Output font '%s' generated." % out_file
|
print "Output font '%s' generated." % out_file
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue