From 23bf977088c651a1afd83e7cebc66e31fafceb6b Mon Sep 17 00:00:00 2001 From: Qwreey Date: Fri, 17 Mar 2023 04:52:58 +0900 Subject: [PATCH] Fix os2 height buggy --- Makefile | 2 +- src/build/NerdFonts/nerdfonts.py | 2 +- src/build/build.py | 44 ++++++++++++++++++++++++-------- 3 files changed, 36 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 67fcf74..81b8c94 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,6 @@ build: @python3 build.py -B 2> out/err.log || { echo "Build Failed. Please check out/err.log for detailed information"; false; } @py3clean . -install: build +install: @cp out/KawaiiMonoRegularPatched.ttf ~/.local/share/fonts/KawaiiMonoRegular.ttf @fc-cache -f -v diff --git a/src/build/NerdFonts/nerdfonts.py b/src/build/NerdFonts/nerdfonts.py index 3097bcb..50b9052 100644 --- a/src/build/NerdFonts/nerdfonts.py +++ b/src/build/NerdFonts/nerdfonts.py @@ -36,7 +36,7 @@ def callPatcher(font): args.progressbars = True # args.quiet = True args.quiet = False - args.adjustLineHeight = True + args.adjustLineHeight = False # args.careful = True args.careful = False args.single = False diff --git a/src/build/build.py b/src/build/build.py index 46b7095..a463386 100644 --- a/src/build/build.py +++ b/src/build/build.py @@ -63,6 +63,30 @@ def build(config=None,weightStr="Regular"): font=kawaii,targetWidth=baseSize ) + # os2 설정 저장 + os2 = { + "os2_subxsize": kawaii.os2_subxsize, + "os2_subysize": kawaii.os2_subysize, + "os2_supxsize": kawaii.os2_supxsize, + "os2_supysize": kawaii.os2_supysize, + "os2_typoascent": kawaii.os2_typoascent, + "os2_typodescent": kawaii.os2_typodescent, + "os2_typolinegap": kawaii.os2_typolinegap, + "os2_width": kawaii.os2_width, + "os2_winascent": kawaii.os2_winascent, + "os2_windescent": kawaii.os2_windescent, + } + + # NerdFonts 패치 적용 + if config.get("NerdFonts"): + NerdFontsLoader.build( + target=kawaii, + NerdFontsAdjust=config.get("NerdFontsAdjust") or False, + baseSize=baseSize, + weightStr=weightStr, + deselectOriginalGlyphs = deselectOriginalGlyphs) + updateOriginalGlyphs() + # 한글 글리프 붇여넣기 if nanumSquareNeo: # 글리프 붇여넣기 @@ -88,18 +112,18 @@ def build(config=None,weightStr="Regular"): deselectOriginalGlyphs = deselectOriginalGlyphs) updateOriginalGlyphs() - # NerdFonts 패치 적용 - if config.get("NerdFonts"): - NerdFontsLoader.build( - target=kawaii, - NerdFontsAdjust=config.get("NerdFontsAdjust") or False, - baseSize=baseSize, - weightStr=weightStr, - deselectOriginalGlyphs = deselectOriginalGlyphs) - updateOriginalGlyphs() - # 반올림 print("Position Rounding . . .",end="",flush=True) + kawaii.os2_subxsize = os2.get("os2_subxsize") + kawaii.os2_subysize = os2.get("os2_subysize") + kawaii.os2_supxsize = os2.get("os2_supxsize") + kawaii.os2_supysize = os2.get("os2_supysize") + kawaii.os2_typoascent = os2.get("os2_typoascent") + kawaii.os2_typodescent = os2.get("os2_typodescent") + kawaii.os2_typolinegap = os2.get("os2_typolinegap") + kawaii.os2_width = os2.get("os2_width") + kawaii.os2_winascent = os2.get("os2_winascent") + kawaii.os2_windescent = os2.get("os2_windescent") kawaii.selection.all() kawaii.round() kawaii.selection.none()