폰트 충실도: 한컴 돋움 폴백을 Noto Sans KR ExtraLight로 (closes #1224)#1234
Merged
edwardkim merged 1 commit intoJun 2, 2026
Conversation
## 원인 (재규명)
이슈 진단("크고 두껍게", em-fill 0.87 vs 0.67)을 동일 스케일 고해상도로 실측한
결과, 잉크 높이는 17px로 동일 — 크기 차이는 없음. 진짜 원인은 **획 두께**:
Noto Sans CJK KR Regular가 한컴 돋움보다 +43% 두꺼움(페이지 밀도 0.378 vs 0.265).
## 설계
SVG 텍스트는 메트릭-DB advance 위치에 클러스터별 <text>를 방출하고 textLength로
가로폭까지 제약 → 위치·자간·가로폭은 모두 제어됨. 유일 미제어 차원은 글리프 획
두께(폴백 폰트가 결정). weight만 한컴 돋움에 근접시키면 레이아웃·메트릭 무변경으로
시각 교정. 채택: Noto Sans KR ExtraLight(wght 200, 페이지 밀도 0.277, OFL).
## 변경
- renderer/mod.rs: generic_fallback sans 체인에 'Noto Sans KR ExtraLight'를
무거운 'Noto Sans KR' 직전 삽입(시스템 고딕 렌더 무영향) + 테스트
- renderer/svg.rs: korean_gothic_substitute() — 돋움/고딕/굴림 계열 임베딩 최후
후보, find_font_file 탐색 경로 말단에 ttfs/opensource 추가
- ttfs/opensource/NotoSansKR-ExtraLight.ttf(+OFL,README): 네이티브 번들(독립 family)
- web/fonts/NotoSansKR-ExtraLight.woff2 + rhwp-studio font-loader.ts:
Haansoft Dotum·돋움·굴림 → ExtraLight 매핑, FONTS.md 갱신
- tech/font_fallback_strategy.md §11 + 측정 보고서·계획서·단계/최종 보고서
## 검증
- 본문 충실도 0.378→0.277 ≈ PDF 0.265 (다문서 3-09·3-11 PDF 정합)
- 레이아웃 불변: dump-pages 3문서 base 대비 바이트 동일(회귀 없음)
- cargo test --lib 1494 passed, 0 failed
## 주요 발견(한계 명시)
- --embed-fonts @font-face는 typst subsetter의 cmap 제거로 <text>에 무효
(실효 경로 = 폴백 체인 + fontconfig/웹폰트). cmap 보존은 후속 과제.
- 네이티브 CLI(rsvg)는 ExtraLight를 fontconfig에 설치해야 적용(웹은 자동).
- 대체폰트는 독립 family 명명 필수('Noto Sans KR' 섀도잉 방지).
## 후속
- 수식 큰 연산자(Σ/∏/∫) 피연산자 간격 누락 → 별도 이슈 edwardkim#1233
013057d to
dbf8aa8
Compare
Owner
|
@planet6897 님, 기여 감사합니다. PR #1234는
추가로 반영 과정에서 Stage 1/2 문서의 Light/ExtraLight 선정 흐름이 오해되지 않도록, Stage 3에서
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
요약
한컴 돋움(Haansoft Dotum) 미설치 시 폴백되는 Noto Sans CJK KR Regular의 획이 한컴 돋움보다 +43% 두꺼워 본문이 PDF보다 과도하게 굵게 렌더되는 문제(#1224)를, 획 두께가 근접한 **Noto Sans KR ExtraLight(wght 200)**로 폴백/대체하여 교정.
원인 재규명
이슈 진단("크고 두껍게", em-fill 0.87 vs 0.67)을 동일 페이지 픽셀폭으로 고해상도 실측:
설계
SVG 텍스트는 메트릭-DB advance 위치에 클러스터별
<text>를 방출하고textLength로 가로폭까지 제약 → 위치·자간·가로폭은 모두 제어됨. 유일 미제어 차원은 글리프 획 두께이며 폴백 폰트가 결정. weight만 한컴 돋움에 근접시키면 레이아웃·메트릭 무변경으로 시각 교정.채택: Noto Sans KR ExtraLight (wght 200) — 페이지 밀도 0.277, 동일 Noto 계열(중립 고딕), OFL, 한글 11,172 완비.
변경
renderer/mod.rs:generic_fallbacksans 체인에 ExtraLight를 무거운 Noto 직전 삽입(시스템 고딕 렌더 무영향) + 테스트renderer/svg.rs:korean_gothic_substitute()임베딩 후보 +find_font_file탐색 경로 말단ttfs/opensourcettfs/opensource/NotoSansKR-ExtraLight.ttf(+OFL, README): 네이티브 번들(독립 family)web/fonts/NotoSansKR-ExtraLight.woff2+rhwp-studio/.../font-loader.ts: Haansoft Dotum·돋움·굴림 → ExtraLighttech/font_fallback_strategy.md §11+ 측정·계획·단계/최종 보고서검증
dump-pages3문서 base 대비 바이트 동일(회귀 없음)cargo test --lib1494 passed, 0 failed알려진 한계
--embed-fonts@font-face는 typst subsetter의 cmap 제거로<text>에 무효 → 실효 경로는 폴백 체인 + fontconfig/웹폰트. (cmap 보존 서브셋은 후속 과제)"Noto Sans KR"섀도잉 방지).후속 이슈
closes #1224