feat(hwp): 심층 충실도 — 병합셀/배경/정렬/글꼴/그림/머리말 + 표 격자 렌더 엔진 (0.20.0) - #3
Merged
Conversation
한컴 스펙 白書(HWPML 3.0 rev1.2) 기준으로 hwp 변환과 docx 페이지 엔진을 함께 고도화한다. '텍스트만 겨우 나오는' 수준에서 문서 구조가 실제로 보이는 수준으로. hwp_convert 재설계 (평면 상태기계 → 레코드 트리 해석): - DocInfo 전체 카탈로그: ID_MAPPINGS(언어별 글꼴 분할)/FACE_NAME/ BORDER_FILL(표 18 배경색)/CHAR_SHAPE(표 28 — 글꼴·취소선 포함 전체)/ PARA_SHAPE(표 38 정렬)/BIN_DATA(표 12 임베딩) - 표 75 셀 속성: col/row/**colspan/rowspan** → docx gridSpan/vMerge 병합, 열 너비(tblGrid)/행 높이(trHeight)/셀 배경(w:shd) - 표 70 캡션(before-tablebody LIST_HEADER) / 중첩 표(셀 안 표 재귀) - 그림 개체: 표 102 PictureInfo.bindata_id → BinData/BIN%04X.ext 스트림 (압축 플래그 준수) → docx 인라인 이미지 (개체 요소 크기 반영) - 글상자 텍스트 본문 승격, 머리말/꼬리말 → docx header/footer - CHAR_SHAPE bits2-3 은 밑줄 **종류**(1 밑줄/2 취소선/3 윗줄) — 취소선을 밑줄로 오독하던 매핑 수정 docx_pages 격자 렌더 엔진 재작성 (hwpx/doc 변환물도 함께 수혜): - vMerge 앵커 rect 가 스팬 전체를 덮는다 (기존: 첫 행만 그리고 아래는 구멍) - 셀 안 문단을 런 스타일 그대로 (기존: 10pt 민짜 텍스트로 뭉갬) - 문단 정렬(w:jc) 본문+셀, 취소선(w:strike), 셀 수직 정렬(w:vAlign), trHeight 최소 행높이, 중첩 표 텍스트 평탄화(내용 무손실) - 표 페이지 분할: 행 경계에서 쪼개고, 경계 걸친 병합 셀은 조각까지만 facade 레거시 정책 수리 (v0.19.0 잠복 버그): - analyze_doc 이 hwp 를 xlsx 분기로 흘리던 실사고 — _fmt_of 에 legacy= allow(읽기: 정규화 후 진행)/reject(편집: 명시 거부) 정책 도입, 전 진입점 배선 테스트: 실파일 레벨 배치 심화 픽스처(make_hwp_rich — 병합 2종/배경/정렬/ 취소선/글꼴/1×1 PNG BinData/머리말) 9건 + 격자 엔진 5건 + 레거시 계약 1건. 906 passed (기존 실패 중이던 test_unsupported_extension_raises 는 새 계약 반영). PNG 래스터 스모크: A4@180dpi, 스타일 색상 픽셀 도달 확인.
This was referenced Aug 31, 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.
무엇
한컴 스펙 白書(HWPML 3.0 rev1.2, reference_data 에 보관) 기준으로 hwp 변환기와 docx 페이지 렌더 엔진을 함께 고도화.
hwp_convert — 평면 상태기계 → 레코드 트리 해석
BinData/BIN%04X.ext→ docx 인라인 이미지(개체 크기 반영)docx_pages — 격자 렌더 엔진 재작성 (hwpx/doc 변환물 동반 수혜)
facade 레거시 정책 (v0.19.0 잠복 버그 수리)
analyze_doc 이 .hwp 를 xlsx 분기로 흘리던 문제 —
_fmt_of(legacy='allow'|'reject')정책으로 읽기 계열은 정규화, 편집 계열은 명시 거부.검증
심화 픽스처(실파일 레벨 배치·표75 셀 속성·PNG BinData 포함) 기반 신규 15건 + 전체 906 passed. PNG 래스터 스모크(A4@180dpi) 스타일 픽셀 도달 확인.
🤖 Generated with Claude Code