Skip to content

fix(layout): keep rows with vertical text as declared and their tables whole - #382

Merged
airmang merged 2 commits into
mainfrom
fix/page-estimate-cells-of-vertical-text
Oct 2, 2026
Merged

airmang merged 2 commits into
mainfrom
fix/page-estimate-cells-of-vertical-text

Conversation

@airmang

@airmang airmang commented Oct 2, 2026

Copy link
Copy Markdown
Owner

바뀐 점

쪽 수 추정(실험, estimate_pages)이 세로쓰기 칸(hp:subList@textDirection="VERTICAL")의 글을 가로 글처럼 칸 폭에서 나누어 행을 키우던 것을 고친다.

  • 한/글은 세로쓰기 칸의 줄을 칸 높이를 따라 세로로 놓는다.
    • 줄은 칸을 가로질러 옆으로 늘어놓는다.
    • 칸에 들어가지 않는 글은 잘린다. 행은 선언 높이 그대로이고 커지지 않는다.
  • 세로쓰기 칸이 있는 흐르는 표는 쪽 끝에서 나뉘지 않는다.
    • 나누지 않게 둔 표(pageBreak="NONE")처럼 통째로 다음 쪽 맨 위로 간다. 한 쪽보다 높아도 그 쪽 바닥을 넘어 그린다.
    • 기준 문단 줄과 그 뒤 글은 앞 쪽에 남는다.
    • 칸을 합쳤든 행마다 세로 칸이 있든 같다.
  • 전에는 그런 칸을 칸 폭에서 줄을 나누었다. 그래서 좁은 세로 칸의 짧은 글도 여러 줄로 세어 행을 키웠고, 표를 쪽 끝에서 나누었다.
  • 코드
    • _vertical(cell): 세로쓰기 칸이면, _cell_row가 그 칸을 선언 높이의 한 덩어리로 센다.
    • _page_break(table): 그런 칸이 있는 표의 쪽 나눔을 NONE으로 본다. 흐르는 표를 만드는 네 곳이 쓴다.
  • 변경 로그를 고친다.

테스트

  • tests/test_layout_page_estimate.py에 한/글 저장본 아홉을 더한다. 흐르는 표의 첫 열이 세로쓰기 칸이고, 10pt 글에 줄 간격 160%다.
  • HANCOM_PAGES(캐시 있음·없음)
    • 3000×4000 칸에 세 글자: 세로 한 줄이다.
    • 서른 글자: 세로 열 줄이 되고, 행은 4000 그대로다.
    • 폭 1500 칸에 예순 글자: 스무 줄이다.
    • 2000 높이 행 넷을 합친 칸에 열 글자.
    • 대조: 같은 꼴(행 스물, 넷씩 합친 칸)에 가로 글이면 표가 쪽 끝에서 나뉜다.
  • test_a_table_holding_vertical_text_moves_to_the_next_page_whole
    • 넷씩 합친 세로 칸, 스무 행 전체를 합친 세로 칸, 행마다 세로 칸, 그리고 한 쪽보다 높은 마흔 행 표.
    • 모두 2쪽이고 표는 통째로 둘째 쪽에 간다. 기준 줄과 뒤 글은 한/글이 놓은 첫 쪽 자리에 놓인다(캐시 있음·없음).
  • 고치기 전 코드에서는 긴 글 둘과 나뉘는 넷(여섯 판)이 실패한다.

🤖 Generated with Claude Code

airmang and others added 2 commits October 2, 2026 21:36
…s whole

A cell of vertical text (hp:subList@textDirection) was laid out like
horizontal text across the cell's width, its lines making the row taller.
Hancom lays such lines down the cell's height side by side across it and
cuts what does not fit: the row stays as declared. A flowing table holding
such a cell does not split over a page end either; it moves to the next
page whole, as one set not to split, its anchor's line and the text after
it staying on the page before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@airmang
airmang merged commit 006eb94 into main Oct 2, 2026
13 checks passed
@airmang
airmang deleted the fix/page-estimate-cells-of-vertical-text branch October 2, 2026 15:34
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