From 742a2fbf85566b544e75e312823b5a4fbcc1546e Mon Sep 17 00:00:00 2001 From: Qwreey Date: Thu, 19 Jan 2023 21:54:55 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20pip=20=EC=95=88=20=EC=93=B0=EA=B3=A0=20?= =?UTF-8?q?git=20submodule=20=EB=A1=9C=20wget=20=EC=9D=84=20=EA=B0=80?= =?UTF-8?q?=EC=A0=B8=EC=98=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitmodules | 3 +++ config.py | 1 + src/NotoMono.py | 2 +- src/build.py | 12 +++++++++--- src/wget | 1 + 5 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 .gitmodules create mode 160000 src/wget diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..3498e2a --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "src/wget"] + path = src/wget + url = https://github.com/steveeJ/python-wget diff --git a/config.py b/config.py index 675dfaa..bf91666 100644 --- a/config.py +++ b/config.py @@ -1,6 +1,7 @@ # TODO: 블록 글자 추가 # TODO: 기울임꼴(ah 같은 특수 기울임도) 추가 +# TODO: 합자 추가 config = { # ------------------------------------------- diff --git a/src/NotoMono.py b/src/NotoMono.py index 47f60bd..14bedca 100644 --- a/src/NotoMono.py +++ b/src/NotoMono.py @@ -10,7 +10,7 @@ def getFontPath(): wgetHandler.download(github_NotoSansMonoCJKkr,"assets/NotoMonoCJKkr.otf") return "assets/NotoMonoCJKkr.otf" -def pasteGlyphs(target,source,baseSize=550): +def pasteGlyphs(target,source,baseSize=550,JapaneseGlyphs=False,CJKUnifiedIdeographs=False): source.cidFlatten() def select(font): diff --git a/src/build.py b/src/build.py index edc259a..9f10704 100644 --- a/src/build.py +++ b/src/build.py @@ -13,7 +13,7 @@ def build(config=None): kawaii.encoding = 'UnicodeFull' # 한글 글리프 붇여넣기 - if config.CopyKoreanGlyphs: + if config.get("CopyKoreanGlyphs"): # 나눔 스퀘어 네오 다운로드/불러오기 nanumSquareNeo = fontforge.open( NanumSquareNeoLoader.getFontPath()) @@ -22,11 +22,17 @@ def build(config=None): target=kawaii,baseSize=550, source=nanumSquareNeo) - if config.CopyJPGlyphs or config.Copy: + if (config.get("CopyJapaneseGlyphs") or + config.get("CopyCJKUnifiedIdeographs")): # 노토 모노 다운로드/불러오기 notoMono = fontforge.open( NotoMonoLoader.getFontPath()) - + # 글리프 붇여넣기 + NotoMonoLoader.pasteGlyphs( + JapaneseGlyphs=config.get("CopyJapaneseGlyphs") or False, + CJKUnifiedIdeographs=config.get("CopyCJKUnifiedIdeographs") or False, + target=kawaii,baseSize=550, + source=nanumSquareNeo) # 생성 kawaii.generate("kawaiiPatched.ttf") diff --git a/src/wget b/src/wget new file mode 160000 index 0000000..fdd3a0f --- /dev/null +++ b/src/wget @@ -0,0 +1 @@ +Subproject commit fdd3a0f8404ccab90f939f9952af139e6c55142a