feat: add motion design pipeline and restore Korean showcase corpus
This commit is contained in:
parent
b5f59ca87a
commit
047df4d08b
63 changed files with 2181 additions and 919 deletions
28
research/composition-practice-2026-10-26/prepare-fonts.py
Normal file
28
research/composition-practice-2026-10-26/prepare-fonts.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
"""현재 실습에 쓰는 글리프만 포함한다. 원본 폰트는 변경하지 않는다."""
|
||||
from pathlib import Path
|
||||
from fontTools.ttLib import TTFont
|
||||
from fontTools.varLib.instancer import instantiateVariableFont
|
||||
from fontTools import subset
|
||||
|
||||
root = Path.cwd()
|
||||
out = root / "outputs/composition-practice-20261026/fonts"
|
||||
out.mkdir(parents=True, exist_ok=True)
|
||||
text = "밤의 독서실늦은 시간까지 열어 두는,함께 읽는 자리.11월 14일18:00–24:00중앙도서관 2층사전 신청 없이 참여가상 행사 · 조판 실습"
|
||||
sources = {
|
||||
"sans": Path.home() / "AppData/Local/Microsoft/Windows/Fonts/PretendardVariable.ttf",
|
||||
"serif": Path("C:/Windows/Fonts/NotoSerifKR-VF.ttf"),
|
||||
}
|
||||
for name, source in sources.items():
|
||||
font = TTFont(source)
|
||||
if "fvar" in font:
|
||||
font = instantiateVariableFont(font, {"wght": 500}, inplace=True)
|
||||
options = subset.Options()
|
||||
options.name_IDs = ["*"]
|
||||
options.name_legacy = True
|
||||
options.name_languages = ["*"]
|
||||
sub = subset.Subsetter(options=options)
|
||||
sub.populate(text=text)
|
||||
sub.subset(font)
|
||||
font.flavor = "woff2"
|
||||
font.save(out / f"{name}.woff2")
|
||||
print(name, "subset bytes", (out / f"{name}.woff2").stat().st_size)
|
||||
Loading…
Add table
Add a link
Reference in a new issue