Skip to content

fix(layout): give picture bullets their room and tabs their section's default stops - #559

Merged
airmang merged 1 commit into
mainfrom
fix/line-cache-wrapped-regress
Oct 24, 2026
Merged

airmang merged 1 commit into
mainfrom
fix/line-cache-wrapped-regress

Conversation

@airmang

@airmang airmang commented Oct 24, 2026

Copy link
Copy Markdown
Owner

What

  • Picture bullets (hh:bullet@useImage): FormFit and the page estimate now give the label the room Hancom gives it — the picture takes an em whatever its shape, then the gap (textOffset, % of the em or HWPUNIT) and the width adjustment, off the first line and, with 자동 내어 쓰기, off every line. Before, a picture bullet counted as no label, so its paragraphs broke later than in Hancom and write_line_caches wrote lines Hancom does not lay out. A picture bullet sized by its picture (useInstWidth) still takes no room in FormFit, and write_line_caches leaves its paragraphs to Hancom.
  • Section tab stops: a tab reaches the default stops of its own section, as far apart as hp:secPr@tabStopVal says (HWPUNIT). The page estimate and write_line_caches counted 4,000 in every section. A section giving its stops in another unit gets no caches.

Both turned up once write_line_caches began writing the sections around objects text runs beside and newspaper columns (#554): those sections used to be skipped whole.

Tests

  • FormFit: a picture bullet's room for gaps of 40 % / 0 % / 500 HWPUNIT, a width adjustment, and useInstWidth (no room).
  • Line cache: tabs in sections with stops 4,000 / 3,600 / given in CHAR; caches for paragraphs under picture bullets.
  • Two Hancom-saved fixtures (laid out and saved by Hangul 2024; author, dates and app version emptied as tests/fixtures/hancom_saved/README.md says) join HANCOM_LAID_OUT: line_cache_picture_bullets.hwpx, line_cache_section_tab_stops.hwpx.

Saving without calling write_line_caches is unchanged apart from FormFit's and the page estimate's widths for these paragraphs.

🤖 Generated with Claude Code

… default stops

A paragraph under a picture bullet (hh:bullet@useImage) loses the room
Hancom gives the picture: an em whatever the picture's shape, then the
gap (textOffset) and the width adjustment, off the first line and, with
자동 내어 쓰기, off every line. FormFit took it as no label at all, so
such paragraphs broke later than in Hancom, and write_line_caches gave
them lines Hancom does not lay out. A picture bullet sized by its picture
(useInstWidth) still takes no room in FormFit; write_line_caches leaves
its paragraphs to Hancom.

A tab reaches the default stops of the section it is in, as far apart
as hp:secPr@tabStopVal says; the page estimate and write_line_caches
counted 4,000 in every section. A section giving its stops in another
unit than HWPUNIT gets no caches.

Both came up once write_line_caches wrote the sections around objects
text runs beside (#554). Two Hancom-saved fixtures show the layouts.

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.

head d44466dd8bc0b6ec799221d50f6e84bc17392ffe를 검토했습니다. picture-bullet → paragraph_label → label_room/문단 head/indent 경로, useInstWidth의 보수적 캐시 조건, _Measure.style의 section tab-stop별 캐시 키, 구역·가상 구역 전환에서의 기본값 재설정 및 명시적 tab-stop 유지, writer의 비HWPUNIT 구역 생략을 주변 코드와 확인했습니다. 저장된 Hancom fixture의 줄/탭 속성 비교를 검토했으며 재현 가능한 미해결 결함은 발견하지 못했습니다.

정확한 head의 CI13개 성공 및 Python3.12 로그의 7,114 passed / 18 skipped / 1 xfailed, coverage90.14%, Ruff·mypy·pyright 통과 확인. 별도 head 체크아웃에서 FormFit 규칙·line-cache·page-estimate 테스트 1,758개 통과.

#558 병합 뒤 최신 main 708a854247530427f6aeaaf99b67eb1ba6c502a5와 로컬에서 충돌 없이 합쳤습니다. tree 9c5b3704f839273de32efbcd2f6db7a13fee05eb는 검증한 head와 소스·테스트가 동일하며, 차이는 최신 README/ledger와 기존 main의 개발 상태 classifier(Alpha→Beta)뿐임을 확인했습니다. 최신 main의 문서·메타데이터를 보존하며 버전·의존성 변경은 없습니다.

자기 PR이므로 COMMENT로 결과를 남깁니다. 병합 직전에 head/main/CI/리뷰 상태를 재확인합니다.

@airmang
airmang merged commit f1c298c into main Oct 24, 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