Task #372: SVG 렌더러 형광펜 배경(charPr.shadeColor) 누락 수정#373
Closed
planet6897 wants to merge 1 commit into
Closed
Conversation
HWPX의 charPr.shadeColor 가 IR/TextRunStyle.shade_color 까지 정상 보존됨에도 SVG 렌더러의 draw_text 가 해당 필드를 사용하지 않아 형광펜 배경이 출력되지 않는 문제를 수정한다. web_canvas.rs:1271-1279 와 동일 로직(텍스트 폭 × 1.2 배 폰트 크기 영역에 <rect> 출력)으로 통일. samples/hwpx/hwpx-h-02.pdf 9쪽의 12개 강조 구문(거주자, 외국법인, 증권을 취득 등) 민트색(#CDF2E4) 배경이 SVG 출력에 정상 표시됨을 확인. closes edwardkim#372
edwardkim
added a commit
that referenced
this pull request
Apr 27, 2026
PR #373 (Task #372): SVG 렌더러 형광펜 배경(charPr.shadeColor) 누락 정정. svg.rs::draw_text 에 <rect> 배경 출력 추가 (html / web_canvas 동일 패턴 이식). 검증: cargo test --lib 1014 passed, svg_snapshot 6/6, hwpx-h-02 9쪽 형광펜 rect 9건 정상 출력, 7 핵심 샘플 회귀 0. orders 갱신 (#372 항목 추가). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
edwardkim
added a commit
that referenced
this pull request
Apr 27, 2026
svg.rs::draw_text 에 charPr.shadeColor 기반 <rect> 배경 출력 추가. html.rs / web_canvas.rs 와 동일 패턴 이식. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Owner
|
SVG 형광펜 배경 정정 PR 검토했습니다. `html.rs` / `web_canvas.rs` 의 동일 패턴 식별 + `svg.rs::draw_text` 에 13 줄 이식. cherry-pick 으로 머지했습니다. 검증: cargo test --lib 1014 passed, svg_snapshot 6/6, hwpx-h-02 9쪽 형광펜 rect 9건 정상 출력, 7 핵심 샘플 회귀 0. 상세: `mydocs/pr/pr_373_report.md` |
Owner
|
cherry-pick 으로 devel 에 머지 완료. |
This was referenced Apr 27, 2026
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.
요약
HWPX
<hh:charPr ... shadeColor="#XXXXXX">으로 지정된 형광펜 배경이 SVG 출력에서 누락되던 문제를 수정한다.samples/hwpx/hwpx-h-02.hwpx9쪽 PDF에는 다수 단어가 민트색(#CDF2E4) 배경으로 강조되어 있으나,rhwp export-svg출력에는 배경이 전혀 그려지지 않았다.closes #372
원인
HWPX 원본 → IR →
TextRunStyle.shade_color까지 값은 정상 보존되지만, SVG 렌더러(src/renderer/svg.rs::draw_text)가 해당 필드를 사용하지 않았다.다른 렌더러는 이미 동일 필드를 정상 사용하고 있었다:
src/renderer/html.rs:334-337—background-colorCSSsrc/renderer/web_canvas.rs:1271-1279—fill_rect변경 내용
src/renderer/svg.rs::draw_text의 클러스터 분할 직후에,style.shade_color의 RGB 가0xFFFFFF(흰색)/0(미설정) 이 아닐 때 텍스트 폭 ×font_size * 1.2영역에<rect>를 먼저 그리는 로직을 추가했다. web_canvas.rs 와 동일한 좌표·크기 시맨틱(시작y - font_size, 높이font_size * 1.2).검증
cargo build --release✅cargo test --release— 1055 ok / 0 failed / 1 ignored (회귀 없음)rhwp export-svg samples/hwpx/hwpx-h-02.hwpx -p 8재출력fill="#cdf2e4"<rect>9건 등장영향 범위
none인 기존 문서: RGB 가드(!= 0xFFFFFF && != 0)로 영향 없음.draw_text)를 타므로 자동 적용됨.변경 파일
src/renderer/svg.rs—draw_text에 형광펜 배경 출력 로직 추가mydocs/plans/task_m100_372.md— 간소 계획서samples/hwpx/hwpx-h-02.pdf— 검증 정답 PDF