Skip to content

fix(form_fit): keep a tab on the automatic tab at the end on its line - #533

Merged
airmang merged 1 commit into
mainfrom
fix/page-estimate-text-and-flowing-table
Oct 20, 2026
Merged

airmang merged 1 commit into
mainfrom
fix/page-estimate-text-and-flowing-table

Conversation

@airmang

@airmang airmang commented Oct 20, 2026

Copy link
Copy Markdown
Owner

무엇을 고쳤나

줄 끝 자동 탭(hh:tabPr@autoTabRight="1")은 줄 끝에 놓인 오른쪽 탭 정지 위치처럼 쓰인다. 탭 뒤에 글이 없으면(문단 끝이나 다음 탭 앞) 탭은 줄 끝까지 닿는다. 한/글은 그런 탭을 그 줄에 두고, 그 뒤 탭은 다음 줄에서 시작한다. 그런데 FormFit 줄 나눔(hancom_line_starts)은 줄 끝에 닿는 탭을 모두 다음 줄로 넘겼다(#475의 "줄 끝에 닿는 탭은 다음 줄로"). 그래서 쪽 수 추정은 "□ 상세 정보⇥"처럼 탭 하나로 끝나는 제목 문단을 줄 배치 정보 없이 배치할 때 두 줄로 셌다.

  • 탭이 자동 탭의 줄 끝 위치에 닿고 탭 뒤 글(다음 탭이나 끝까지)이 없으면 그 줄에 남는다(_on_auto_tab_right).
  • 탭 뒤에 글이 있는데 줄 끝에 닿는 탭, 그리고 문단 자기 탭·기본 탭으로 닿는 탭은 전처럼 다음 줄로 간다.
  • 줄 배치 정보 쓰기(실험)는 자동 탭 문단을 계속 건너뛰므로 영향이 없다.

시험

  • tests/test_form_fit_hancom_rules.py::test_a_tab_on_the_automatic_tab_at_the_end_stays_on_its_line: 탭 하나로 끝, 42자 뒤 탭, 빈칸 뒤 탭, 탭 둘, 탭 뒤 넘치는 글.
  • 한/글 저장 픽스처 pages_tab_stops_automatic_right_at_the_end(합성: 2~42음절 문단을 양쪽·왼쪽 정렬로, 탭·빈칸+탭·탭 둘·탭+글로 끝냄)를 HANCOM_PAGES에 넣음. 줄 배치 정보를 지운 사본에서도 모든 줄이 한/글 자리에 온다.
  • 고치기 전에는 새 시험 2개가 실패한다(단위 시험, 캐시 없는 쪽 추정).
  • 전체 시험 통과(이 PC의 심볼릭 링크·설치 휠 관련 기존 실패만 남음), ruff·mypy·pyright 통과.

CHANGELOG.md [Unreleased]/고침 맨 위에 항목 하나. 병합 대기 중인 FormFit PR들과 form_fit/measure.py·CHANGELOG.md에서 겹칠 수 있다.

🤖 Generated with Claude Code

A tab that reaches the line's end on the automatic tab at the end
(hh:tabPr@autoTabRight) with no text after it -- at the paragraph's end,
or before another tab -- stays on its line, as Hancom Office lays it
out; a tab after it starts the next line. FormFit and the page estimate
used to move every tab reaching the margin to the next line, so a
heading ending in such a tab was counted as two lines. A tab with text
after it that reaches the margin still goes on to the next line.

A Hancom-saved fixture holds 220 paragraphs of 2-42 syllables ending in
a tab, a space and a tab, two tabs, or a tab and text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@airmang
airmang force-pushed the fix/page-estimate-text-and-flowing-table branch from 86625d8 to 73bf246 Compare October 20, 2026 07:35
@airmang
airmang merged commit 8bced3a into main Oct 20, 2026
13 checks passed
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