수식 포함 줄 본문 한글 압축·겹침 해소 (closes #1219)#1223
Merged
edwardkim merged 1 commit intoJun 1, 2026
Merged
Conversation
문제: 인라인 수식(treat-as-char)이 포함된 줄의 본문 한글이 압축되어 겹침 (3-09월_교육_통합_2023 6쪽 문26, advance 8.96px/0.746em). 문단은 align=Left, 자간 0%, 장평 100% 로 압축 의도가 없으나, 줄 폭 측정이 available_width 를 초과해 비정렬 오버플로우 압축이 발동했다. 근본 원인 (둘 다 측정/렌더 불일치): 1. est_x 측정 루프와 total_tac_width_in_line 이 전역 tac_offsets_px 를 run 경계로 재필터 → 줄 끝 위치(= 다음 줄 선두)의 수식을 현재 줄 폭에 오포함. 2. 선두 미주 마커가 endnote_marker_x_advance(inline_offset) 와 footnote_positions 측정(fn_text 위첨자) 양쪽에서 이중 계상. 렌더는 인라인 위첨자를 그리지 않음. 수정 (측정을 렌더의 줄-경계/마커 규칙에 통일): - TAC 소스를 line_tac_offsets(= tac_offsets_for_line, pos<다음 줄 시작)로 통일. - footnote_positions 측정에서 start_line==0 의 선두 미주(Endnote) 제외. 결과: 문26 한글 advance 8.96 → 11.93px (PDF 한글 2022 12px 정합), 겹침 해소. cargo test 1896 passed (golden SVG 스냅샷 8건 포함). 회귀 가드 테스트 추가. 비고: 글리프가 PDF보다 크게 보이는 현상은 폰트 대체(Noto Sans CJK KR ↔ 한컴 돋움) 문제로 본 건과 별개 (별도 추적).
edwardkim
added a commit
that referenced
this pull request
Jun 1, 2026
@planet6897. golden SVG 8건 무회귀, 1925 passed, 한글 advance 8.96→11.93px. SVG 시각 판정 통과. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Owner
|
머지했습니다(devel 두 측정/렌더 불일치를 정확히 짚으셨습니다 — (1) 검증:
측정 경로 변경이라 WASM 을 재빌드했습니다. 글리프 크기(폰트 대체) 별도 이슈 분리도 적절합니다. 감사합니다. |
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.
문제
인라인 수식(treat-as-char)이 포함된 줄의 본문 한글이 압축되어 겹침 (
samples/3-09월_교육_통합_2023.hwp6쪽 문26, advance 8.96px(0.746em)). 해당 문단은 align=Left·자간 0%·장평 100% 로 압축 의도가 없음.근본 원인 (둘 다 측정/렌더 불일치)
est_x측정 루프와total_tac_width_in_line이 전역tac_offsets_px를 run 경계로 재필터 → 줄 끝 위치(= 다음 줄 선두)의 수식을 현재 줄 폭에 오포함 (문26 라인0 에 다음 줄a₁=b₁=155px 가산).endnote_marker_x_advance(inline_offset) 와footnote_positions측정(fn_text 위첨자) 양쪽에서 이중 계상. 렌더는 인라인 위첨자를 그리지 않음.→
total_text_width > available_width거짓 오버플로우 → 비정렬(Left) 줄에 음수 자간 압축.수정 (
paragraph_layout.rs— 측정을 렌더의 줄-경계/마커 규칙에 통일)line_tac_offsets(=tac_offsets_for_line,pos < 다음 줄 시작엄격 미만)로 통일.footnote_positions측정에서start_line==0의 선두 미주(Endnote) 제외.결과
검증
cargo test --release→ 1896 passed / 0 failed (golden SVG 스냅샷 8건 포함, 인라인 TAC·각주·목차·우측탭 회귀 없음).tests/issue_1219_equation_line_hangul_advance.rs(문26 줄 한글 최소 advance ≥ 11.0px 단언).비고
글리프가 PDF보다 크게 보이는 현상은 폰트 대체(Noto Sans CJK KR ↔ 한컴 돋움; 같은 em 에서 Noto 글리프가 ~30% 큼) 문제로 본 건과 별개 — 별도 이슈로 추적 예정.
🤖 Generated with Claude Code