fix(xlsx): fill table cells to the full line height with Excel insets#410
Merged
Conversation
XLSX auto-height rows rendered ~22% taller than Excel (17.15pt vs 14.0pt for a 10pt font, issue #396). Two causes: 1. A single-line cell occupied only the font's metric box (ascender + descender, ~0.94em); the single-spacing leading tops up the space *between* lines, so a one-line cell was left short. Cells now emit a fixed line box spanning the font's full hhea line (split by the ascender/descender ratio, zero leading), the height Word gives a cell line. This also lifts DOCX Korean cells closer to Word (18pt -> 21pt; the remaining gap to Malgun's metrics is #404). 2. Typst's default 5pt vertical cell inset overflowed the row. XLSX tables now use ~1pt vertical / 2pt horizontal insets, the latter the value the column-spill estimate already assumes. Verified: the sales-dashboard rows drop from 17.15pt to 13.5pt against Excel's 14.0pt; no cell content is clipped. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
The PR #186 acceptance test hard-coded the overlay geometry for the old 5pt cell padding; XLSX cells now use ~2pt insets (issue #396), so the overlay offsets track the smaller padding (dx -2pt, length 100%+4pt). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
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.
Summary
XLSX auto-height rows rendered ~22% taller than Excel — 17.15pt vs 14.0pt for a 10pt font (issue #396). Two causes:
Measured on
06_sales_dashboard_en.xlsx: row pitch drops from 17.15pt to 13.5pt against Excel's 14.0pt (0.5pt residual, no content clipped).Related issue
Fixes #396
Testing
cargo test --workspace— green06_sales_dashboard_en.xlsx(rows match Excel) and03_meeting_minutes_ko.docx(Korean cells taller, toward GT, no clipping)Visual impact
Visual audit
06_sales_dashboard_en.xlsx(synthetic real-world audit set, external)fixassets/bugfixes/issue-396/gt.jpgassets/bugfixes/issue-396/before.jpgassets/bugfixes/issue-396/after.jpgVisual comparison
Required inspection
Deviation audit
Checklist
Signed-off-byline🤖 Generated with Claude Code