Repository navigation
feat(engines): table layout for the layout engine - #842
Merged
Merged
Conversation
… borders, page splits Cells placed on a grid with row and column spans; absolute, relative or equal column widths (other formats' tables scaled to the text width); padding, vertical alignment, nested tables; rows as high as 한글 sizes them (content without the last line's spacing); fills and solid, dashed, dotted, dash-dot and double borders; captions. Tables split across pages by 한글's mode, between rows or inside rows that may split, with header rows repeated. 한글's outer margin, offset of tables placed at their paragraph, tables sitting in a paragraph's line and tables starting their paragraph (whose stored lines now still map) are kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
KnifeLemon
changed the base branch from
engine/page-composer
to
builtin-engines
October 30, 2026 16:02
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: tables".
Stacked on #840 (page composer). The base is
engine/page-composer; it moves tobuiltin-enginesonce #840 is merged.Table layout (
Typesetting/TableLayout.cs)PageComposer)한글's placement of tables
These came from comparing against 한글's own PDF, exported through 한글 automation. The model gains three layout-only members on
HTable; the writers ignore them.OuterMargin(hp:outMargin): the space kept around the table.VerticalOffset(hp:pos vertOffset): where a table placed at its paragraph sits below the paragraph's top. 한글 puts the paragraph's text right under the table, without its space before.OpensParagraph: the table is the first thing in its paragraph. The text after it keeps the paragraph's stored lines, whose starts still map, because the table is no text in the model. The reader used to drop those starts as "split by a table".Measured
Against 한글's own PDFs of the HWPX files attached to issues (not in the repository):
Feature matrix against rhwp:
tableslines 15% → 100%, SSIM 0.19 → 0.97. The thresholds are raised.The two exam papers (#51, #65) are two-column pages with equations; those are later items.
Tests
PageComposerTests: column widths (absolute, relative, equal); scaling for other formats against 한글's kept widths; row heights and vertical alignment; a spanning cell with an auto-placed neighbour; a table that must not split; splitting between rows with header rows repeated; a row split inside its cells unless it can't split; a nested table; 한글's margin and offset for a table in an empty paragraph.DocumentModelTests: a table starting its paragraph keeps the paragraph's stored line starts, its offset and its outer margin.🤖 Generated with Claude Code