mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-11-07 01:53:24 +09:00
23 lines
893 B
Python
23 lines
893 B
Python
"""Download the fonts the hype reel uses into ./fonts (SIL OFL 1.1, Google Fonts). Run once before rendering."""
|
|
import os
|
|
import urllib.request
|
|
|
|
HERE = os.path.dirname(os.path.abspath(__file__))
|
|
GF = 'https://github.com/google/fonts/raw/main/ofl/'
|
|
FONTS = {
|
|
'Archivo[wdth,wght].ttf': GF + 'archivo/Archivo%5Bwdth,wght%5D.ttf',
|
|
'Archivo-Italic[wdth,wght].ttf': GF + 'archivo/Archivo-Italic%5Bwdth,wght%5D.ttf',
|
|
'JetBrainsMono[wght].ttf': GF + 'jetbrainsmono/JetBrainsMono%5Bwght%5D.ttf',
|
|
}
|
|
|
|
if __name__ == '__main__':
|
|
out = os.path.join(HERE, 'fonts')
|
|
os.makedirs(out, exist_ok=True)
|
|
for name, url in FONTS.items():
|
|
path = os.path.join(out, name)
|
|
if not os.path.exists(path):
|
|
print('fetching', name)
|
|
with urllib.request.urlopen(url) as r, open(path, 'wb') as f:
|
|
f.write(r.read())
|
|
print('fonts ready in', out)
|