mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-22 00:08:04 +02:00
Use a framed icon on macOS
Fits better with Apple's icon style
This commit is contained in:
12
logo/make.py
12
logo/make.py
@@ -7,7 +7,8 @@ import subprocess
|
||||
import shutil
|
||||
|
||||
base = os.path.dirname(os.path.abspath(__file__))
|
||||
src = os.path.join(base, 'kitty.svg')
|
||||
unframed_src = os.path.join(base, 'kitty.svg')
|
||||
framed_src = os.path.join(base, 'kitty-framed.svg')
|
||||
|
||||
|
||||
def abspath(x):
|
||||
@@ -21,14 +22,15 @@ def run(*args):
|
||||
raise SystemExit('You are missing the {} program needed to generate the kitty logo'.format(args[0]))
|
||||
|
||||
|
||||
def render(output, sz=256):
|
||||
print('Rendering at {0}x{0}...'.format(sz))
|
||||
def render(output, sz=256, src=unframed_src):
|
||||
print(f'Rendering {os.path.basename(src)} at {sz}x{sz}...')
|
||||
run('rsvg-convert', '-w', str(sz), '-h', str(sz), '-o', output, src)
|
||||
run('optipng', '-quiet', '-o7', '-strip', 'all', output)
|
||||
|
||||
|
||||
def main():
|
||||
render(abspath('kitty.png'))
|
||||
render(abspath('kitty-128.png'), sz=128)
|
||||
iconset = abspath('kitty.iconset')
|
||||
if os.path.exists(iconset):
|
||||
shutil.rmtree(iconset)
|
||||
@@ -37,9 +39,7 @@ def main():
|
||||
for sz in (16, 32, 64, 128, 256, 512, 1024):
|
||||
iname = os.path.join(iconset, 'icon_{0}x{0}.png'.format(sz))
|
||||
iname2x = 'icon_{0}x{0}@2x.png'.format(sz // 2)
|
||||
render(iname, sz)
|
||||
if sz == 128:
|
||||
shutil.copyfile(iname, abspath('kitty-128.png'))
|
||||
render(iname, sz, src=framed_src)
|
||||
if sz > 16 and sz != 128:
|
||||
shutil.copy2(iname, iname2x)
|
||||
if sz in (64, 1024):
|
||||
|
||||
Reference in New Issue
Block a user