Skip to content

fix(layout): place a square-wrapped object after text on its first line from the paragraph's top - #394

Merged
airmang merged 1 commit into
mainfrom
fix/page-estimate-square-object-after-text-on-the-first-line
Oct 2, 2026
Merged

airmang merged 1 commit into
mainfrom
fix/page-estimate-square-object-after-text-on-the-first-line

Conversation

@airmang

@airmang airmang commented Oct 2, 2026

Copy link
Copy Markdown
Owner

바뀐 점

쪽 수 추정(실험, estimate_pages)이 문단 글 뒤에 놓인 어울림(SQUARE) 개체를 지원 밖(... wrapped square after text)으로 두던 것을, 그 개체의 조판 부호가 문단 첫 줄에 있을 때 고친다.

  • 한/글은 개체의 문단 기준 세로 자리를 부호가 놓인 줄의 윗선에서 잰다. 이때 줄은 문단을 단 전체 폭으로 놓았을 때의 줄이다.
    • 부호가 첫 줄에 있으면 그 윗선은 문단 윗선이라, 글 앞에 놓인 개체와 같다.
    • 띠에 닿는 줄은 그 문단의 줄도 곁으로 간다. 곁에서 다시 나뉘어, 부호가 곁 줄로는 둘째 줄에 오더라도 개체는 문단 윗선에 선다.
  • 코드
    • _on_first_line이 문단을 단 전체 폭에서 FormFit으로 나누어 부호가 첫 줄에 있는지 본다.
    • 첫 줄에 있으면 _square_object가 개체를 글 앞 개체처럼 돌려준다.
    • 부호가 뒤 줄에 있으면 전처럼 지원 밖이다.
  • 변경 로그 항목을 더한다.

테스트

  • tests/test_layout_page_estimate.py의 HANCOM_PAGES에 한/글 저장본 셋을 더한다. 캐시가 있을 때와 없을 때를 모두 시험한다.
    • 공통 조건: 표는 30000×20000이고 단 왼쪽에 어울림으로 둔다. 문단은 8000 아래에 있고, 10pt 글에 줄 간격 160%다.
    • '가' 16자 뒤에 표: 그 문단의 줄이 표 곁에 한 줄 12자씩 놓인다.
    • 같은데 2383 아래로 띄움: 문단 줄은 표 위라서 전체 폭이고, 뒤 문단들이 곁으로 간다.
    • 대조로 표가 글 앞: 첫 판과 같다.
  • test_a_square_object_after_text_past_the_first_line_is_not_followed: 부호가 60자 뒤라 전체 폭으로 둘째 줄인 저장본이다. 한/글은 그 줄 윗선(9600)에서 잰다. 아직 지원 밖임을 단언한다.
  • 고치기 전 코드에서는 앞의 두 저장본이 캐시가 있든 없든 실패한다.

🤖 Generated with Claude Code

…ne from the paragraph's top

A square-wrapped object whose control follows text in its paragraph was
unsupported. Hancom places such an object from the top of the line its
control falls on, the paragraph laid out the column's whole width: on the
first line that is the paragraph's top, as for an object before the
text, and the lines reaching its band go beside it, the paragraph's own
included. The estimate now follows that when FormFit puts the control on
the paragraph's first line; past it, the object stays unsupported.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@airmang
airmang merged commit c5410dc into main Oct 2, 2026
13 checks passed
@airmang
airmang deleted the fix/page-estimate-square-object-after-text-on-the-first-line branch October 2, 2026 21:06
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