map_pua_emoji: use itertools.chain() to concatenate dict.items()
parent
3d5ac2aea9
commit
03e6d6e39c
|
@ -19,6 +19,7 @@
|
||||||
__author__ = 'roozbeh@google.com (Roozbeh Pournader)'
|
__author__ = 'roozbeh@google.com (Roozbeh Pournader)'
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
import itertools
|
||||||
|
|
||||||
from fontTools import ttLib
|
from fontTools import ttLib
|
||||||
|
|
||||||
|
@ -53,8 +54,9 @@ def add_pua_cmap(source_file, target_file):
|
||||||
"""Add PUA characters to the cmap of the first font and save as second."""
|
"""Add PUA characters to the cmap of the first font and save as second."""
|
||||||
font = ttLib.TTFont(source_file)
|
font = ttLib.TTFont(source_file)
|
||||||
cmap = font_data.get_cmap(font)
|
cmap = font_data.get_cmap(font)
|
||||||
for pua, (ch1, ch2) in (list(add_emoji_gsub.EMOJI_KEYCAPS.items())
|
for pua, (ch1, ch2) in itertools.chain(
|
||||||
+ list(add_emoji_gsub.EMOJI_FLAGS.items())):
|
add_emoji_gsub.EMOJI_KEYCAPS.items(), add_emoji_gsub.EMOJI_FLAGS.items()
|
||||||
|
):
|
||||||
if pua not in cmap:
|
if pua not in cmap:
|
||||||
glyph_name = get_glyph_name_from_gsub([ch1, ch2], font)
|
glyph_name = get_glyph_name_from_gsub([ch1, ch2], font)
|
||||||
if glyph_name is not None:
|
if glyph_name is not None:
|
||||||
|
|
Loading…
Reference in New Issue