mirror of https://github.com/zulip/zulip.git
build_emoji: Fix the spritesheet CSS generation code.
Modify the spritesheet generation code to account for the differences between emoji_map.json and iamcal's dataset. Due to the differences between the two mappings, some emojis like 1️⃣, 2️⃣ etc were not getting rendered properly in the two emoji pickers where we are using the iamcal's spritesheets for rendering them. This was so because there was no CSS class corresponding to the codepoints of these emojis(as mapped using emoji_map.json) in our spritesheet CSS(generated using iamcal's dataset). Fixes: #4775.
This commit is contained in:
parent
0667297c6e
commit
0d28d5d808
|
@ -265,6 +265,16 @@ def dump_emojis(cache_path):
|
|||
'pos_x': (emoji["sheet_x"] * 100) / 40,
|
||||
'pos_y': (emoji["sheet_y"] * 100) / 40,
|
||||
}
|
||||
# Remove the code below once the migration to iamcal's dataset is complete.
|
||||
emoji_name = emoji['short_name']
|
||||
codepoint = emoji['unified'].lower()
|
||||
if emoji_name in emoji_map and codepoint != emoji_map[emoji_name]:
|
||||
emoji_positions += EMOJI_POS_INFO_TEMPLATE % {
|
||||
'codepoint': emoji_map[emoji_name],
|
||||
'pos_x': (emoji["sheet_x"] * 100) / 40,
|
||||
'pos_y': (emoji["sheet_y"] * 100) / 40,
|
||||
}
|
||||
|
||||
for emojiset in EMOJISETS:
|
||||
sprite_sheet = os.path.join(EMOJI_DATA_PATH, 'sheet_%s_32.png' % (emojiset,))
|
||||
run(['cp', sprite_sheet, cache_path], shell=True)
|
||||
|
|
Loading…
Reference in New Issue