ok
This commit is contained in:
@@ -13,9 +13,27 @@ try:
|
||||
with urllib.request.urlopen(req) as response:
|
||||
with zipfile.ZipFile(io.BytesIO(response.read())) as z:
|
||||
for info in z.infolist():
|
||||
if info.filename.endswith("Inter-Regular.ttf") or info.filename.endswith("Inter-Bold.ttf"):
|
||||
info.filename = os.path.basename(info.filename)
|
||||
targets = ["Inter-Regular.ttf", "Inter-Bold.ttf", "Inter-Italic.ttf", "Inter-BoldItalic.ttf"]
|
||||
filename = os.path.basename(info.filename)
|
||||
if filename in targets:
|
||||
info.filename = filename
|
||||
z.extract(info, "assets/fonts/")
|
||||
print(f"Extracted {info.filename}")
|
||||
except Exception as e:
|
||||
print(f"Failed to get Inter: {e}")
|
||||
|
||||
maple_url = "https://github.com/subframe7536/maple-font/releases/download/v6.4/MapleMono-ttf.zip"
|
||||
print(f"Downloading Maple Mono from {maple_url}")
|
||||
try:
|
||||
req = urllib.request.Request(maple_url, headers={'User-Agent': 'Mozilla/5.0'})
|
||||
with urllib.request.urlopen(req) as response:
|
||||
with zipfile.ZipFile(io.BytesIO(response.read())) as z:
|
||||
for info in z.infolist():
|
||||
targets = ["MapleMono-Regular.ttf", "MapleMono-Bold.ttf", "MapleMono-Italic.ttf", "MapleMono-BoldItalic.ttf"]
|
||||
filename = os.path.basename(info.filename)
|
||||
if filename in targets:
|
||||
info.filename = filename
|
||||
z.extract(info, "assets/fonts/")
|
||||
print(f"Extracted {info.filename}")
|
||||
except Exception as e:
|
||||
print(f"Failed to get Maple Mono: {e}")
|
||||
|
||||
Reference in New Issue
Block a user