Task #977: 목차 개요번호 WASM 정렬 어긋남 정정 — 문자 폭 폴백 공용화#1045
Closed
planet6897 wants to merge 1 commit into
Closed
Conversation
목차(개요번호) 페이지를 rhwp-studio(WASM)로 열 때 선두 공백 글자의 CharShape가 인접 문단과 다르면 일부 개요번호가 ~9px 어긋났다. export-svg(네이티브)는 정상이라 WASM 전용 문제였다. 원인: src/renderer/layout/text_measurement.rs 의 compute_char_positions 가 플랫폼별 이중 구현 — 네이티브 EmbeddedTextMeasurer 는 미등록 폰트 폭을 휴리스틱 (한컴 PDF 정합 기준)으로, WASM WasmTextMeasurer 는 브라우저 measureText 실측으로 산출. 미등록 폰트 공백 폭이 WASM 에서만 폰트별로 달라져 개요번호가 어긋났다. 변경(text_measurement.rs 단일 파일): - 공용 함수 base_char_width 신설 (내장 메트릭 → 휴리스틱 폴백) - EmbeddedTextMeasurer 인라인 if-else → base_char_width (순수 리팩터, 네이티브 불변) - WasmTextMeasurer 의 measure_char_width_hwp(JS 실측) → base_char_width 로 통일 - 사용처 없어진 wasm_internals::measure_char_width_hwp 제거 - 옛한글 합성 클러스터 경로는 회귀 방지로 종전 유지 검증: cargo build / cargo test 전체 0 failed (golden SVG 회귀 무 — 네이티브 불변), cargo check --lib --target wasm32-unknown-unknown OK. closes edwardkim#977 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Owner
|
검토 완료 — 이전 동일 현상 처리와 중복된 것으로 판단되어 close 합니다. 처리 경위
메인테이너 hands-on 검증 결과임시 테스트 브랜치에서 본 PR 의도 우선으로 충돌 해소 후 WASM 빌드 진행:
판단코드 측 무결성 자체는 양호하나, PR #977 의 본질 (WASM 목차 개요번호 ~9px 어긋남, 선두 공백 폰트 폭 불일치) 이 PR #1026 의 본질 (WASM 좁은 구두점 폭 분류 + native/WASM 동기화) 과 동일 영역의 폰트 폭 정합 문제입니다. PR #1026 머지로 본질 해결되어 본 PR 의 기여 영역이 흡수된 상태입니다. 이력
후속 권고
기여 감사합니다. |
edwardkim
added a commit
that referenced
this pull request
May 25, 2026
- pr_1095_review.md: 검토 (v3 본질 분리 + 코드 정독 + 메인테이너 검증 계획) - pr_1095_report.md: 최종 결정 — merge 수용 (검증 7/7 + CI 전부 pass) 검증: - 회귀 가드 #874: 1/1 PASS - svg_snapshot: 8/8 PASS - lib 1382 passed / 0 failed - WASM check / clippy / fmt clean - CI 전부 pass 본 PR 의 본질: - v2 #1045 (PR #1026 흡수로 close) 후 잔존 본질 - measure_hangul_width_hwp 도 native heuristic 동기화 (PR #1026 의 measure_char_width_hwp 영역 외 추가) - 영향 영역: 미등록 폰트만 (등록 폰트는 _embedded 가 Some 반환 → 무회귀) merge: 471d5bf (GitHub merge commit), 이슈 #977 close. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
문제
목차(개요번호 포함) 페이지를 rhwp-studio(WASM)로 열면, 선두 공백 글자의 CharShape가 인접 문단과 다를 때 일부 개요번호가 ~9px 어긋났다.
export-svg(네이티브) 출력은 정상이라 WASM 전용 문제.원인
src/renderer/layout/text_measurement.rs의compute_char_positions가 플랫폼별 이중 구현:EmbeddedTextMeasurer— 미등록 폰트 폭을 휴리스틱(한컴 PDF 정합 기준)으로 산출WasmTextMeasurer— 미등록 폰트를 브라우저measureText실측미등록 폰트 공백 폭이 WASM 에서만 폰트별로 달라져, 선두 공백 폰트가 다른 인접 목차 문단의 개요번호가 어긋났다.
변경 (
text_measurement.rs단일 파일)base_char_width신설 — 내장 메트릭 → 휴리스틱 폴백EmbeddedTextMeasurer인라인 if-else →base_char_width(순수 리팩터, 네이티브 동작 불변)WasmTextMeasurer—measure_char_width_hwp(JS 실측) →base_char_width(휴리스틱) 통일wasm_internals::measure_char_width_hwp제거검증
cargo build✅cargo test전체 0 failed (golden SVG 회귀 무 — 네이티브 동작 불변)cargo check --lib --target wasm32-unknown-unknown✅closes #977
🤖 Generated with Claude Code