Repository navigation
feat(engines): follow 한글's stored line layout where it can be used - #839
Merged
Merged
Conversation
The HWPX reader converts 한글's text positions (eight per control, one per line break and special space, as Hancom's HWP 5.0 document defines them) into positions in the layout's text. Paragraphs whose stored lines weren't estimated by Filee and whose fonts are all installed start their lines where 한글 started them, with the stored height and baseline, beside objects where 한글 put them, and squeeze a stored line that no longer fits between its characters as 한글 does. Otherwise the paragraph is broken again and ParagraphBox.StoredLinesIgnored says why. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
KnifeLemon
changed the base branch from
engine/paragraph-layout
to
builtin-engines
October 30, 2026 15:12
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.
What does this change?
Implements the Project 4 item "Layout engine: honor stored HWP/HWPX line layout (fidelity mode)".
Stacked on #834 (paragraph layout). The base is
engine/paragraph-layoutfor a readable diff; it moves tobuiltin-enginesonce #834 is merged.Why
An HWPX that 한글 saved stores each paragraph's lines (
hp:linesegarray: start, height, baseline, position, width). 한글 itself draws from them when it opens the file; it does not break the lines again. I checked this with 한글 through automation:Reader: 한글 positions → model positions
HLineLayout.Starts).Layout
horzpos/horzsize).ParagraphBox.StoredLinesIgnoredsays why.ParagraphLayouter(storedLines: false)andFileeRenderer.ToPdf(storedLines: false)turn it off, for tests and a future preview setting.Measured on the HWPX files attached to Filee's issues (#49, #51, #65; not in the repository)
Tests
DocumentModelTests: positions convert across a tab, a footnote, a line break and an equation. A start inside an equation keeps no positions, and neither does a paragraph split by a table.ParagraphLayoutTests:🤖 Generated with Claude Code