Skip to content

XLSX: account for thick row borders in printed tracks - #1384

Merged
developer0hye merged 2 commits into
mainfrom
fix/issue-1228-thick-top-row-height
Aug 29, 2026
Merged

XLSX: account for thick row borders in printed tracks#1384
developer0hye merged 2 commits into
mainfrom
fix/issue-1228-thick-top-row-height

Conversation

@developer0hye

@developer0hye developer0hye commented Aug 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • read both row-boundary flags from raw worksheet XML because public umya-spreadsheet v2 drops thickTop; upstream support is proposed in fix: preserve row thickTop MathNya/umya-spreadsheet#359 and merged into the workspace's v2 fork in fix: preserve row thickTop umya-spreadsheet#8
  • add Excel's fixed 1pt reservation for an automatic row's current thickTop and the preceding automatic row's thickBot, after the font-dependent row-track mapping
  • keep customHeight rows unchanged because their declared tracks already include those boundaries, with a regression against the native monthly-budget chart size
  • add 150 DPI fix evidence showing all nine SH107 table baselines and eight baseline pitches move onto the native Excel grid

Related issue

Related: #1228

Testing

  • red regression before the fix: SH107's nine printed row heights were all Some(17.0) instead of 18/19/17/19/19/17/17/17/17
  • red custom-height regression before narrowing the rule: two 40pt rows grew to 41pt and 42pt
  • cargo fmt --check
  • cargo test -p office2pdf --lib -- parser::xlsx::tests — 275 passed
  • cargo test -p office2pdf --lib -- parser::xlsx::row_boundaries::tests — 2 passed
  • cargo test -p office2pdf --test xlsx_fixtures — 206 passed
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo publish --dry-run -p office2pdf --allow-dirty — packaged library verified against public crates.io dependencies
  • python3 scripts/compare_layout.py ... --page 1 --noise-floor 0.5 --audit — after: 0.00pt mean/worst baseline delta, 0.00pt pitch delta, no large shifts
  • python3 scripts/compare_render.py ... --page 1 --dpi 150 --artifacts-dir ... --lines
  • magick compare -metric AE -fuzz 5% ... — page-1 AE fell from 132,379 pixels (6.29253%) before to 35,937 (1.70824%) after
  • final-build 150 DPI page-1 raster is byte-identical to the committed after.jpg source raster
  • git diff --check
  • visual evidence validator — no errors

Visual impact

  • No rendered PDF change
  • Rendered PDF change or visual evidence added
  • Reason: Automatic rows with thick top/bottom boundary flags now reserve the native fixed points in their printed tracks.

Visual audit

  • Issue: XLSX: a row declaring thickTop prints at the bare recomputed track, where Excel grows it 2pt #1228
  • Fixture: tests/fixtures/xlsx/SH107-9-x-9-Formatted-Table.xlsx
  • Page(s): page 1 for fix evidence; output page 2 also inspected and confirmed inkless
  • Renderer and DPI: native Excel-for-Mac PDF export and pdftoppm, 150 DPI
  • Evidence mode: fix
  • New follow-up issues found in this audit: None
  • Model vision findings: The full page, 5% diff, and matched header/table/thick-row crops show the before table compressing upward after each thick boundary. After the fix all row rules, baselines, fills, dark double outlines, and orange underlines align with GT; the inkless extra page, black Col9 label, and sub-point right-aligned text offset remain separately tracked below.
  • GT: assets/bugfixes/issue-1228/gt.jpg
  • Before: assets/bugfixes/issue-1228/before.jpg
  • After: assets/bugfixes/issue-1228/after.jpg

Visual comparison

GT Before After
GT Before After

Required inspection

  • Rendered all evidence at 150 DPI or higher
  • Stored progressive JPEG quality 86 assets with metadata stripped
  • Used Codex/Claude vision to inspect the full GT/output pages, diff, and matched crops
  • Inspected matched region crops at full resolution
  • Ran compare_layout.py --audit and dispositioned every large text-instance shift
  • Ran the 5% fuzz pixel-difference sweep
  • Inventoried hairlines and border dash styles
  • Inventoried font weight, italic, and underline emphasis

The hairline inventory covers every light-blue cell rule, the dark double outlines around Col5/1.5, and the orange rules under Col8/1.8; all are present at the matching positions and none uses a dash pattern. The emphasis inventory confirms the bold header labels, italic Col6/1.6, bold 1.4, and underlined orange runs. The remaining page-1 diff clusters are text colour/raster placement covered by #1230 and #1233, plus accepted antialiasing; #1229 covers the inkless second page outside the evidence page.

Deviation audit

Check Result
Page count/order Remaining: #1229 tracks the inkless second page; the native export has one page.
Element presence Matches GT on page 1 — every label, value, fill, rule, and outline is present.
Position/size Remaining: #1233 tracks sub-point horizontal placement of right-aligned runs; all nine baselines and eight row pitches are fixed and match GT exactly.
Rotation/flip No deviation observed — the fixture contains no rotated or flipped elements.
Fill Matches GT — all header, band, and highlighted-cell fills align.
Stroke/border Matches GT — all light-blue hairlines, dark double outlines, and orange underlines are present at matching positions and no dash styles occur.
Shape outline geometry No deviation observed — the page has no shapes beyond the audited cell borders.
Text content Matches GT — all 81 cell values and nine header labels are present.
Font family/weight/style Matches GT — header bold, Col6/1.6 italic, 1.4 bold, and orange underlined emphasis are preserved.
Text color Remaining: #1230 tracks the black Col9 header label that is white in GT.
Alignment Remaining: #1233 tracks the right-aligned trailing-advance residual; vertical alignment is fixed.
Line/paragraph spacing Fixed — native and output baseline pitches are 19/17/19/19/17/17/17/17pt.
Clipping/overflow Remaining: #1229 tracks value-less trailing columns that create the blank overflow page; no page-1 clipping was observed.

Checklist

  • Commits include a Signed-off-by line
  • PR scope contains one root cause
  • Remaining visual deviations each reference an open issue

Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
@developer0hye
developer0hye merged commit 1e0487c into main Aug 29, 2026
35 checks passed
@developer0hye
developer0hye deleted the fix/issue-1228-thick-top-row-height branch August 29, 2026 09:37
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