fix(layout): keep the cached lines of a paragraph of an object and spaces - #391
Merged
airmang merged 1 commit intoOct 2, 2026
Merged
Conversation
…aces A paragraph holding one object set as a character and, besides it, only spaces or line breaks was broken into lines by FormFit even when it had a valid layout cache, in the body and in table cells. It now keeps the cache's lines, as any other paragraph does and as Hancom does when it opens the file; FormFit breaks it only without a cache. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
airmang
deleted the
fix/page-estimate-cached-lines-of-an-object-and-spaces
branch
October 2, 2026 19:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
바뀐 점
쪽 수 추정(실험,
estimate_pages)이 글자처럼 둔 개체 하나와 공백·줄 바꿈만 있는 문단을, 줄 캐시가 유효해도 FormFit 줄 나눔(_Measure.spread_lines)으로 다시 나누던 것을 고친다.spread_lines(..., caches=True)는 문단에 유효한 캐시가 있으면 그 줄을 돌려준다(두 줄 이상일 때). 한 줄이면 전처럼 개체 높이의 한 줄이다. FormFit은 캐시가 없을 때만 나눈다._paragraph), 표 칸의 줄 쌓기(_Measure.stack)와 줄별 높이(_Measure.stack_lines)가 모두 그렇게 부른다.테스트
tests/test_layout_page_estimate.py에test_a_paragraph_of_an_object_and_spaces_keeps_its_cached_lines를 더한다. 한/글 저장본 둘에서 글자처럼 둔 표의 폭만 바꾼다. 캐시는 그대로라서, 캐시와 FormFit이 서로 다른 줄 수를 낸다.🤖 Generated with Claude Code