Skip to content

TAC Picture 인라인 문단의 line advance 가 image height 만 사용 (lh+ls 누락) #462

@planet6897

Description

@planet6897

증상

samples/exam_kor.hwp 페이지 1 우측 단의 pi=25 (TAC Control::Picture, 빈 문단+그림) 직후 pi=26 사이 여백이 약 20.5px 부족. PDF 와 비교하여 너무 좁음.

좌표 분석

  • pi=25 이미지 bottom: y=1113.58
  • pi=26 line_top: y=1113.57 (실제 갭 ~0)
  • HWP 소스가 의도한 advance: lh(24525) + ls(688) = 25213 HU = 336.17 px
  • 현재 advance: image_height = 23675 HU = 315.67 px
  • 누락: leading(11.33) + line_spacing(9.17) = 20.51 px

원인

src/renderer/layout.rs:2724 의 TAC Picture 인라인 경로:

result_y = pic_y + pic_h;

이미지 박스 높이만 사용하고 LINE_SEG 의 lh+ls 를 무시. TAC Shape 보정 (1929-1958) 은 Control::Shape 만 매칭하므로 Picture 에 적용 안 됨.

수정 (옵션 A)

layout.rs:2724 (와 2727 의 동일 로직) 에서 line advance 를 LINE_SEG 기반으로 변경:

let line_advance = para.line_segs.first()
    .map(|ls| hwpunit_to_px(ls.line_height + ls.line_spacing, self.dpi))
    .unwrap_or(pic_h);
result_y = pic_y + line_advance.max(pic_h);

마일스톤

v1.0.0 / M100

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions