emoji: Remove code for generating old sprite sheets.

This commit is contained in:
Tim Abbott 2017-05-03 13:34:30 -07:00
parent b20a24875a
commit 110f161288
1 changed files with 0 additions and 16 deletions

View File

@ -26,7 +26,6 @@ from scripts.lib.zulip_tools import run
AA_SCALE = 8
SIZE = (136, 136)
SPRITE_SIZE = (50, 50)
BIG_SIZE = tuple([x * AA_SCALE for x in SIZE])
EMOJI_DUMP_DIR_PATH = os.path.join(ZULIP_PATH, 'var', 'emoji_dump')
@ -97,7 +96,6 @@ def color_font(name, code_point, code_point_to_fname_map):
in_name = 'bitmaps/strike0/{}.png'.format(glyph_name)
out_name = 'out/unicode/{}.png'.format(code_point)
out_sprite_name = 'out/sprite/{}.png'.format(name)
# These emojis are colored white and need to be recolored
white_emojis = ['eight', 'five', 'four', 'hash', 'nine', 'one',
@ -110,9 +108,6 @@ def color_font(name, code_point, code_point_to_fname_map):
white_emoji_image.paste('#40C0E7', white_emoji_image)
white_emoji_image.save(in_name)
shutil.copyfile(in_name, out_name)
image = Image.new('RGBA', SIZE)
image.paste(Image.open(out_name), (0, 2))
image.resize(SPRITE_SIZE, Image.ANTIALIAS).save(out_sprite_name, 'PNG')
except IOError:
raise MissingGlyphError('code_point: %r' % (code_point))
@ -131,9 +126,6 @@ def bw_font(name, code_point):
image.resize(SIZE, Image.ANTIALIAS).save(
'out/unicode/{}.png'.format(code_point), 'PNG'
)
image.resize(SPRITE_SIZE, Image.ANTIALIAS).save(
'out/sprite/{}.png'.format(name), 'PNG'
)
def code_point_to_file_name_map(ttx):
# type: (str) -> Dict[int, Union[Text, bytes]]
@ -212,11 +204,7 @@ def dump_emojis(cache_path):
except OSError:
pass
for fname in glob.glob("sprite*"):
os.remove(fname)
os.mkdir('out')
os.mkdir('out/sprite')
os.mkdir('out/unicode')
failed = False
@ -248,15 +236,11 @@ def dump_emojis(cache_path):
print("Errors dumping emoji!")
sys.exit(1)
subprocess.call('glue --quiet out/sprite . --margin=1 --namespace=emoji --sprite-namespace= --retina',
shell=True)
cache_emoji = os.path.join(cache_path, 'images', 'emoji')
cache_emoji_unicode = os.path.join(cache_path, 'images', 'emoji', 'unicode')
run(['rm', '-rf', cache_path])
run(['mkdir', '-p', cache_emoji])
run(['mv', 'out/*', cache_emoji], shell=True)
run(['mv', 'sprite*', cache_path], shell=True)
assets = "{}/static/assets/zulip-emoji/*".format(ZULIP_PATH)
run(['cp', '-RPp', assets, cache_emoji_unicode], shell=True)