(WIP) config 자동 생성 및 gate4 / 동작 검증 실패 (local RAM 부족)

This commit is contained in:
jaehwang committed 2026-09-07 17:20:27 +09:00
1 parent 89d9062f35
commit c3f40899a4
25 files changed
+679 -1

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
"""동봉 폰트 로더. 없으면 그 자리에서 죽는다 — 기본 폰트로 떨어지면 타이포가 어긋난다."""
from functools import lru_cache
from pathlib import Path
from PIL import ImageFont
FONT_DIR = Path(__file__).resolve().parent.parent / "assets" / "fonts"
PRETENDARD = "Pretendard-{weight}.otf"
GYEONGGI = "GyeonggiTitleVOTF-Bold.otf"
@lru_cache(maxsize=32)
def font(weight: str, size: int) -> ImageFont.FreeTypeFont:
path = FONT_DIR / PRETENDARD.format(weight=weight)
if not path.exists():
raise RuntimeError(f"폰트 없음: {path}")
return ImageFont.truetype(str(path), size)
@lru_cache(maxsize=8)
def title_font(size: int) -> ImageFont.FreeTypeFont:
path = FONT_DIR / GYEONGGI
if not path.exists():
raise RuntimeError(f"폰트 없음: {path}")
return ImageFont.truetype(str(path), size)