Skip to content

fix(layout): lay an empty line below a top-and-bottom object beside floating ones - #393

Merged
airmang merged 1 commit into
mainfrom
fix/page-estimate-empty-line-below-an-object-beside-floating-ones
Oct 2, 2026
Merged

airmang merged 1 commit into
mainfrom
fix/page-estimate-empty-line-below-an-object-beside-floating-ones

Conversation

@airmang

@airmang airmang commented Oct 2, 2026

Copy link
Copy Markdown
Owner

바뀐 점

쪽 수 추정(실험, estimate_pages)이 글 없는 문단에 위아래로 둔 개체(표·그림, 문단 위 0)와 글 앞·뒤로 둔 개체가 함께 있을 때, 빈 줄을 위아래 개체의 윗선에 두던 것을 고친다.

  • 한/글은 빈 줄을 그 개체 아래에 전체 폭으로 둔다. 문단에 공백이나 머리표가 있을 때와 같다.
    • 뜬 개체가 종이 기준이든 문단 기준이든, 글 앞이든 뒤든 같다.
    • 위아래 개체만 있으면 전처럼 윗선에 폭 0으로 둔다.
  • 본문: 줄 캐시가 있어도 줄을 윗선에 두어 뒤 글이 한 줄 높게 놓였다. 이제 _anchored_object가 뜬 개체를 머리표처럼 다룬다(_beside_floating).
  • 표 칸: 이런 문단은 캐시가 없으면 지원 밖(a nested table)이었다. 이제 뜬 개체를 문단의 개체로 세지 않고, 빈 줄을 표 아래로 보낸다(_object_before_text, _table_before_text).
  • 변경 로그: fix(layout): let a cell's table set as a character stand alone beside floating objects #381 항목의 '캐시 없이는 지원 밖' 줄을 고치고, 새 항목을 더한다.

테스트

  • tests/test_layout_page_estimate.py의 HANCOM_PAGES에 한/글 저장본 다섯을 더한다. 캐시가 있을 때와 없을 때를 모두 시험한다.
    • 공통 조건: 빈 문단은 8000 아래에 있다. 위아래 표는 6659이고, 바깥 여백은 위 283·아래 1417이다.
    • 표 + 종이 기준 글 뒤 그림: 빈 줄이 16359다.
    • 표 + 문단 기준 글 뒤 그림(표와 겹침): 같다.
    • 표 + 글 앞 그림: 같다.
    • 위아래 그림 + 글 뒤 그림: 같다.
    • 대조로 표만 있으면 빈 줄은 8000에 폭 0이다.
  • #381의 칸 저장본(표 + 글 뒤 사각형)을 HANCOM_PAGES로 옮긴다. 캐시 없이 지원 밖임을 단언하던 시험은 지운다.
  • 고치기 전 코드에서는 본문 넷이 캐시가 있든 없든 실패하고, 칸 저장본은 캐시 없이 실패한다.

🤖 Generated with Claude Code

…loating ones

A paragraph holding no text, an object placed top and bottom from its top
and, beside it, objects in front of or behind the text had its empty line
on the object's top, taking no room. Hancom sets that line below the
object at full width, as for a space or a label, whether the floating
object is placed on the paper or from the paragraph, in front of the text
or behind it: in the body and in table cells, where such a paragraph was
unsupported without caches. With the top-and-bottom object alone, the
line stays on its top.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@airmang
airmang merged commit 52c4fe6 into main Oct 2, 2026
13 checks passed
@airmang
airmang deleted the fix/page-estimate-empty-line-below-an-object-beside-floating-ones branch October 2, 2026 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant