pretty prints

master
Qwreey 2023-03-17 03:44:22 +09:00
parent 2d55e92464
commit 684b6f4554
No known key found for this signature in database
GPG Key ID: 01D9B192033CF43F
2 changed files with 15 additions and 1 deletions

View File

@ -12,9 +12,19 @@ def downloadPatcher():
print("Unzipping NerdFontPatcher.zip",end="")
with zipfile.ZipFile("assets/NerdFontPatcher.zip", 'r') as zip_ref:
extractName = zip_ref.extractall("assets/NerdFontPatcher_extract")
os.rename("assets/NerdFontPatcher_extract/font-patcher","assets/NerdFontPatcher_extract/fontPatcher.py")
with open("assets/NerdFontPatcher_extract/__init__.py","w") as file:
file.write("")
with open("assets/NerdFontPatcher_extract/font-patcher") as file:
patcherCode = file.read()
patcherCode = patcherCode.replace(
'sys.stdout.write("Adding " + str(max(1, glyphSetLength)) + " Glyphs from " + setName + " Set \\n")',
'sys.stdout.write("\\x1b[2K\\r Adding " + str(max(1, glyphSetLength)) + " Glyphs from " + setName + " Set \\n")')
patcherCode = patcherCode.replace('text = "\\r╢{0}{1}%"','text = "\\x1b[2K\\r ╢{0}{1}%"')
patcherCode = patcherCode.replace('sys.stdout.write("\\n")','pass')
patcherCode = patcherCode.replace('print("Very wide','print(" Very wide')
patcherCode = patcherCode.replace('print("Redistributing line','print(" Redistributing line')
with open("assets/NerdFontPatcher_extract/fontPatcher.py",mode="w") as file:
file.write(patcherCode)
print(" [OK]")
return "assets/NerdFontPatcher_extract"

View File

@ -90,8 +90,12 @@ def build(target,deselectOriginalGlyphs,NerdFontsAdjust=True,baseSize=550,weight
print("Patching: NerdFonts")
# NerdFonts 공식 패처를 수행함
print(" Calling NerdFonts Patcher . . .",flush=True)
callPatcher(target)
print("\x1b[2K\r [OK]")
# 적절한 크기를 위해서 크기조절을 수행함
if NerdFontsAdjust:
print(" Adjusting size . . .",end=False,flush=True)
postScript(target,deselectOriginalGlyphs,baseSize)
print(" [OK]")