Skip to content

feat(layout): page estimate for an object on the paper over some of the columns - #362

Merged
airmang merged 4 commits into
mainfrom
feat/page-estimate-paper-objects-over-some-columns
Oct 1, 2026
Merged

airmang merged 4 commits into
mainfrom
feat/page-estimate-paper-objects-over-some-columns

Conversation

@airmang

@airmang airmang commented Oct 1, 2026

Copy link
Copy Markdown
Owner

바뀐 점

쪽 수 추정(실험, estimate_pages)이 같은 폭의 여러 단 쪽에서 종이 기준으로 둔 위아래 배치 개체를 한/글처럼 둔다.

  • 전에는 개체가 본문 너비를 다 덮을 때만 따랐다. 조금이라도 좁으면 지원 밖(objects placed on the paper)이었다.
  • 한/글은 개체가 가로로 걸치는 단에서만 줄을 개체 아래로 보낸다. 걸치지 않는 단의 줄은 개체가 없을 때 자리에 둔다.
    • 단에 조금만 걸쳐도 그 단 전체가 막힌다. 단 사이 간격 안에서 끝나는 개체는 그 단을 막지 않는다.
    • 앵커 문단이 뒤 단에 있어도 같은 쪽의 앞 단까지 그렇다.
  • 이제 _paper_band가 개체가 걸치는 단을 함께 돌려주고, _lay_section은 그 단에만 띠를 둔다.
    • 걸치는 단은 _columns_reached가 고른다. 종이의 왼쪽·가운데·오른쪽을 기준으로 둔 개체의 자리를 바깥 여백까지 쳐서 단마다 견준다.
    • 단 자리를 세려고 _Page에 단 사이 간격(gap)을 더한다. _columns가 같은 폭 단의 간격을 함께 돌려준다.
    • 개체 자리를 구하는 부분은 _paper_left로 뺀다. _across_the_text도 이것을 쓴다.
  • 폭이 다른 단, 종이가 아닌 기준으로 둔 개체, 곁에 자리가 남는 어울림 개체는 전처럼 지원 밖이다.
  • 변경 로그를 고친다.

테스트

  • tests/test_layout_page_estimate.py에 한/글 저장본 아홉을 더한다(HANCOM_PAGES). 모두 2단 또는 3단 쪽 맨 위에 종이 기준으로 둔 개체다.
    • 2단: 왼단 위·오른단 위 개체, 두 단에 조금씩 걸친 개체, 본문보다 400 좁은 개체(사각형·표)
    • 경계: 오른단에 100 걸친 개체, 간격 안에서 끝나는 개체, 오른단 문단에 앵커한 왼단 위 개체
    • 3단: 가운데 단 위 개체
    • 캐시가 있을 때와 없을 때 모두 줄 위치와 쪽 수가 한/글과 같다.
  • _columns가 단 사이 간격도 돌려주므로, 이것을 직접 부르는 기존 테스트 하나의 기대값을 고친다.
  • 고치기 전 코드에서는 새 테스트 열여덟이 실패한다(기대값을 고친 위 테스트도 실패한다).

🤖 Generated with Claude Code

airmang and others added 4 commits October 1, 2026 21:35
…he columns

An object placed top and bottom on the paper in columns of equal width keeps the lines out of its band only
in the columns it reaches over (from the paper's left, centre or right, outer margins included); the other
columns run past it. Such an object narrower than the text was unsupported.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, at a column's edge, anchored in a later column

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@airmang
airmang merged commit 7981f68 into main Oct 1, 2026
13 checks passed
@airmang
airmang deleted the feat/page-estimate-paper-objects-over-some-columns branch October 1, 2026 19:11
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