Skip to content

fix(form_fit): set tabs on Hancom's default tab stops - #470

Merged
airmang merged 2 commits into
mainfrom
fix/form-fit-default-tab-stops
Oct 16, 2026
Merged

airmang merged 2 commits into
mainfrom
fix/form-fit-default-tab-stops

Conversation

@airmang

@airmang airmang commented Oct 16, 2026

Copy link
Copy Markdown
Owner

What

FormFit and the page estimate now lay a tab out as Hancom Office does, and the page estimate measures the lines after a forced line break as later lines.

  • A tab reaches the next default tab stop: one every 4000 HWPUNIT from the column's left edge (in a cell, from its text area's left edge), the next one strictly past the current position. A line starts at the paragraph's left margin, the first one further in by its indent; a hanging indent applies from the second line.
  • A line may break on either side of a tab.
  • Paragraphs whose tab definition has its own stops or automatic tabs are measured as before (TextStyle.tab_stop = 0).
  • The lines after a hp:lineBreak are no first line: they take the other lines' width, without the first-line indent.

Before, a tab was measured like a space-sized character, so paragraphs with tabs broke their lines differently from Hancom, and an indented paragraph with a line break could get an extra line.

Tests

  • New Hancom-saved fixtures (saved by Hancom Office 2024, scrubbed): tabs after Hangul at several margins and indents, labels with two tabs, tabs among runs of several sizes and of several faces, line breaks in indented paragraphs of several sizes, and all of them together. Each fails before this change without the line caches and passes after.
  • test_a_tab_reaches_the_next_default_stop_from_the_columns_left_edge covers the margin, the indent, a continued line and tab_stop=0.

🤖 Generated with Claude Code

airmang and others added 2 commits October 16, 2026 10:03
FormFit and the page estimate now lay a tab out as Hancom Office does:

- A tab reaches the next default tab stop, every 4000 HWPUNIT from the
  column's (or the cell's text area's) left edge. A line starts at the
  paragraph's left margin, the first one further in by its indent; a
  hanging indent applies from the second line.
- A line may break on either side of a tab.
- Paragraphs whose tab definition has its own stops or automatic tabs are
  measured as before.

The lines after a forced line break are not the paragraph's first line: the
page estimate measures them at the other lines' width, without the indent.

Hancom-saved fixtures cover tabs after Hangul and indents, tabs among runs of
several sizes and faces, and line breaks in indented paragraphs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The page estimate's shape lookups did not offer the tab definitions, so it laid out the tabs of a paragraph with stops of its own on the default stops. It now reads them, and lays such a tab out as before, as FormFit does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@airmang airmang left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

48eb786 검토 완료. 기본 탭 위치와 왼쪽 여백/들여쓰기의 기준, 탭 양쪽 줄 나눔, 여러 크기·글꼴의 고정 advance, 강제 줄바꿈 뒤 continued 처리와 사용자 탭 정의의 기존 fallback을 확인했습니다. 별도 Python 3.12 체크아웃에서 관련 기존/회귀 테스트 781개가 통과했습니다. 해당 head의 CI 13개가 모두 성공했으며 실제 Python 3.12 로그에서 6,756 passed / 18 skipped / 1 xfailed, coverage 89.97%, mypy/Pyright 성공을 확인했습니다. main/head가 검토한 상태이고 미해결 리뷰 스레드가 없습니다. 병합을 막는 결함을 찾지 못했습니다.

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