Fix heading print

master
Qwreey 2023-03-11 21:51:11 +09:00
parent 9816ee7f6d
commit d87dfa9ee2
11 changed files with 30 additions and 8 deletions

View File

@ -1,6 +1,6 @@
build: build:
@mkdir -p out @mkdir -p out
@python3 build.py -B 2> out/err.log @python3 build.py -B 2> out/err.log || { echo "Build Failed. Please check out/err.log for detailed information"; false; }
@py3clean . @py3clean .
install: build install: build

View File

@ -3,5 +3,6 @@ patchVersion = 2 # 업데이트 후 캐시를 무시하기 위해서 사용
from . import select as selectGlyphs from . import select as selectGlyphs
from .download import download from .download import download
from .download import isCached
from .cacheBuilder import getCachedFont from .cacheBuilder import getCachedFont
from .patcher import pasteGlyphs from .patcher import pasteGlyphs

View File

@ -20,3 +20,5 @@ def download():
shutil.rmtree('assets/NanumSquareNeoKr.extract') shutil.rmtree('assets/NanumSquareNeoKr.extract')
print(" [OK]") print(" [OK]")
return "assets/NanumSquareNeoKr.ttf" return "assets/NanumSquareNeoKr.ttf"
def isCached(): return os.path.exists("assets/NanumSquareNeoKr.ttf")

View File

@ -1,3 +1,4 @@
from .download import downloadPatcher from .download import downloadPatcher
from .download import isCached
from .download import nerdFonts_Download_Test from .download import nerdFonts_Download_Test

View File

@ -18,4 +18,6 @@ def downloadPatcher():
print(" [OK]") print(" [OK]")
return "assets/NerdFontPatcher_extract" return "assets/NerdFontPatcher_extract"
def isCached(): return os.path.exists("assets/NerdFontPatcher_extract")
def nerdFonts_Download_Test(): downloadPatcher() def nerdFonts_Download_Test(): downloadPatcher()

View File

@ -2,6 +2,7 @@
patchVersion = 2 patchVersion = 2
from .download import download from .download import download
from .download import isCached
from . import select as selectGlyphs from . import select as selectGlyphs
from .cacheBuilder import getCachedFont from .cacheBuilder import getCachedFont
from .patcher import pasteGlyphs from .patcher import pasteGlyphs

View File

@ -9,3 +9,5 @@ def download():
if not os.path.exists("assets/NotoMonoCJKkr.otf"): if not os.path.exists("assets/NotoMonoCJKkr.otf"):
wgetHandler.download(github_NotoSansMonoCJKkr,"assets/NotoMonoCJKkr.otf") wgetHandler.download(github_NotoSansMonoCJKkr,"assets/NotoMonoCJKkr.otf")
return "assets/NotoMonoCJKkr.otf" return "assets/NotoMonoCJKkr.otf"
def isCached(): return os.path.exists("assets/NotoMonoCJKkr.otf")

View File

@ -22,7 +22,7 @@ def pasteGlyphs(target,sourcePath,deselectOriginalGlyphs,EnabledItems,baseSize=5
selectGlyphs.SelectByEnabledList(source,EnabledItems) selectGlyphs.SelectByEnabledList(source,EnabledItems)
deselectOriginalGlyphs(source) deselectOriginalGlyphs(source)
source.copy() source.copy()
selectGlyphs.SelectByEnabledList(source,target) selectGlyphs.SelectByEnabledList(target,EnabledItems)
deselectOriginalGlyphs(target) deselectOriginalGlyphs(target)
target.paste() target.paste()

View File

@ -27,7 +27,6 @@ def CJKUnifiedIdeographs(font):
# CJK Unified Ideograph # CJK Unified Ideograph
font.selection.select(selFlag,0x4E00,0x9FFF) font.selection.select(selFlag,0x4E00,0x9FFF)
def CJKUnifiedIdeographsExtension(font): def CJKUnifiedIdeographsExtension(font):
font.selection.select(selFlag,0x3400,0x4DBF) # Extension A font.selection.select(selFlag,0x3400,0x4DBF) # Extension A
font.selection.select(selFlag,0x20000,0x2A6DF) # Extension B font.selection.select(selFlag,0x20000,0x2A6DF) # Extension B

View File

@ -13,10 +13,16 @@ def build(config=None):
# 메인 폰트 불러오기 / 에셋 다운로드 # 메인 폰트 불러오기 / 에셋 다운로드
kawaii = fontforge.open( kawaii = fontforge.open(
KawaiiMonoLoader.getFontPath()) KawaiiMonoLoader.getFontPath())
print("-------------- DOWNLOAD PATCH CONTENTS --------------") downloadContentHeader = False
def printDownloadContentHeader():
nonlocal downloadContentHeader
if downloadContentHeader == False:
downloadContentHeader = True
print("-------------- DOWNLOAD PATCH CONTENTS --------------")
# 나눔 스퀘어 네오 다운로드 # 나눔 스퀘어 네오 다운로드
nanumSquareNeo = None nanumSquareNeo = None
if config.get("CopyKoreanGlyphs"): if config.get("CopyKoreanGlyphs"):
if not NanumSquareNeoLoader.isCached(): printDownloadContentHeader()
nanumSquareNeo = NanumSquareNeoLoader.download() nanumSquareNeo = NanumSquareNeoLoader.download()
# 노토 모노 다운로드/불러오기 # 노토 모노 다운로드/불러오기
notoMono = None notoMono = None
@ -24,12 +30,14 @@ def build(config=None):
config.get("CopyCJKUnifiedIdeographs") or config.get("CopyCJKUnifiedIdeographs") or
config.get("CopyCJKUnifiedIdeographsExtension") or config.get("CopyCJKUnifiedIdeographsExtension") or
config.get("CopyCJKCompatibilityIdeographs")): config.get("CopyCJKCompatibilityIdeographs")):
if not NotoMonoLoader.isCached(): printDownloadContentHeader()
notoMono = NotoMonoLoader.download() notoMono = NotoMonoLoader.download()
# Nerd fonts 패치기 다운로드 # Nerd fonts 패치기 다운로드
nerdFontsPatcherPath = None nerdFontsPatcherPath = None
if config.get("NerdFonts"): if config.get("NerdFonts"):
if not NerdFontsLoader.isCached(): printDownloadContentHeader()
nerdFontsPatcherPath = NerdFontsLoader.downloadPatcher() nerdFontsPatcherPath = NerdFontsLoader.downloadPatcher()
print("--------------------- Patching ---------------------") print("--------------------- Patching ----------------------")
# 유지 목록 (덮어쓰기 금지) 만들기 # 유지 목록 (덮어쓰기 금지) 만들기
kawaii.selection.all() kawaii.selection.all()
@ -64,10 +72,10 @@ def build(config=None):
EnabledItems = { EnabledItems = {
"JapaneseGlyphs": config.get("CopyJapaneseGlyphs") or False, "JapaneseGlyphs": config.get("CopyJapaneseGlyphs") or False,
"CJKUnifiedIdeographs": config.get("CopyCJKUnifiedIdeographs") or False, "CJKUnifiedIdeographs": config.get("CopyCJKUnifiedIdeographs") or False,
"CJKUnifiedIdeographsExtension": config.get("CopyCJKUnifiedIdeographsExtension"), "CJKUnifiedIdeographsExtension": config.get("CopyCJKUnifiedIdeographsExtension") or False,
"CJKCompatibilityIdeographs": config.get("CopyCJKCompatibilityIdeographs"), "CJKCompatibilityIdeographs": config.get("CopyCJKCompatibilityIdeographs") or False,
"Symbols": config.get("CopySymbols") or False,
}, },
Symbols=config.get("CopySymbols") or False,
target=kawaii,baseSize=550, target=kawaii,baseSize=550,
sourcePath=notoMono, sourcePath=notoMono,
deselectOriginalGlyphs = deselectOriginalGlyphs) deselectOriginalGlyphs = deselectOriginalGlyphs)

View File

@ -4,3 +4,9 @@
경우가 2가지 있다. 글리프를 x,y 모두 중앙으로 옮겨도 바운딩 박스가 화면을 초과하는 경우. 이 경우 x,y 모두 글리프가 초과하지 못하도록 안쪽으로 들어가게 축소를 넣어준다 (퍼센트 계산 둘다 x,y 한다 그런다음 가장 크게 줄여야 하는 퍼센트를 선택한다) 경우가 2가지 있다. 글리프를 x,y 모두 중앙으로 옮겨도 바운딩 박스가 화면을 초과하는 경우. 이 경우 x,y 모두 글리프가 초과하지 못하도록 안쪽으로 들어가게 축소를 넣어준다 (퍼센트 계산 둘다 x,y 한다 그런다음 가장 크게 줄여야 하는 퍼센트를 선택한다)
아 Bold 구현 ㅐ해야하는데 너무 귀찮으니 미래의 내가 해줄꺼라고 믿고 있어
(미래의 나 오열?)