correct prebuild nerd font glyphset and post.isFixedPitch: 0 -> 1 #295

This commit is contained in:
subframe7536 2024-12-13 15:18:44 +08:00
parent d2631597e8
commit 95d6f0ed71
3 changed files with 8 additions and 3 deletions

View file

@ -53,7 +53,7 @@ def update_config_json(config_path: str, version: str):
def check_update(): def check_update():
current_version = None current_version = None
with open("./config.json", "r") as f: with open("./config.json", "r", encoding="utf-8") as f:
data = json.load(f) data = json.load(f)
current_version = data["nerd_font"]["version"] current_version = data["nerd_font"]["version"]
@ -70,6 +70,9 @@ def check_update():
if latest_version == current_version: if latest_version == current_version:
print("✨ Current version match latest version") print("✨ Current version match latest version")
if not check_font_patcher(latest_version):
print("Font-Patcher not exist and fail to download, exit")
exit(1)
return return
print( print(
@ -135,13 +138,15 @@ def subset(mono: bool, unicodes: list[int]):
) )
subsetter.subset(font) subsetter.subset(font)
font.save(f"source/MapleMono-NF-Base{'-Mono' if mono else ''}.ttf") _path = f"source/MapleMono-NF-Base{'-Mono' if mono else ''}.ttf"
font.save(_path)
run(f"ftcli fix monospace {_path}")
font.close() font.close()
def main(): def main():
check_update() check_update()
with open("./FontPatcher/glyphnames.json", "r") as f: with open("./FontPatcher/glyphnames.json", "r", encoding="utf-8") as f:
unicodes = parse_codes_from_json(json.load(f)) unicodes = parse_codes_from_json(json.load(f))
subset(True, unicodes=unicodes) subset(True, unicodes=unicodes)
subset(False, unicodes=unicodes) subset(False, unicodes=unicodes)

Binary file not shown.

Binary file not shown.