Skip to content

fix(xlsx): seat centered multi-row text blocks - #1507

Merged
developer0hye merged 1 commit into
mainfrom
fix/issue-1497-merged-title-seat
Sep 2, 2026
Merged

fix(xlsx): seat centered multi-row text blocks#1507
developer0hye merged 1 commit into
mainfrom
fix/issue-1497-merged-title-seat

Conversation

@developer0hye

@developer0hye developer0hye commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • seat vertically centred XLSX cells spanning fixed-height rows against the full joined track instead of Typst's text-metric box
  • preserve the existing one-row, bottom-aligned multi-row, top-aligned, auto-row, and non-spreadsheet paths
  • reproduce Excel's lower-half resolution of a symmetric multi-row centre on its 1/300-inch PDF position grid
  • add a compiled two-row/two-line regression that uses a portable embedded font and automatic wrapping

Related issue

Fixes #1497

Testing

  • cargo test --locked -p office2pdf centered_two_row_sheet_merge_uses_the_full_fixed_track_seat -- --nocapture
  • cargo test --locked -p office2pdf sheet_cell -- --nocapture (28/28)
  • cargo test --locked -p office2pdf row_spanning_cell_keeps_its_declared_alignment_in_a_tight_row -- --nocapture
  • cargo test --locked -p office2pdf centered_fixed_sheet_rows_share_one_center_across_two_and_three_wrapped_lines -- --nocapture
  • full workspace coverage: 2,806 library tests, DOCX/PPTX/XLSX/public-visual/PDF/CLI/package integration suites, and doctests passed across the workspace run and explicit remaining-suite runs
  • the first contended workspace run reached perf_medium_xlsx_conversion_under_30_seconds at 33.52s after the long rendering suites; its unchanged isolated rerun passed at 12.933s, and no threshold or fixture was changed
  • python3 -m unittest discover -s scripts/tests -p 'test_*.py' (326 tests; 30 business mocks and stored layout baseline included)
  • cargo fmt --check
  • git diff --check
  • cargo check --locked --workspace
  • cargo clippy --locked --workspace --all-targets -- -D warnings
  • cargo check --locked --target wasm32-unknown-unknown -p office2pdf
  • cargo check --locked --target wasm32-unknown-unknown -p office2pdf --features wasm
  • cargo check --locked --target wasm32-unknown-unknown -p office2pdf --features wasm-cjk-font
  • wasm-pack build crates/office2pdf --target web --features wasm
  • wasm-pack build crates/office2pdf --target web --features wasm-cjk-font
  • Node WASM tests with CARGO_PROFILE_DEV_DEBUG=0: 10/10 general and 11/11 CJK passed
  • exact-main versus branch rendering of all 10 business XLSX fixtures (17 pages): 9 PDFs byte-identical; 08_budget_ko.xlsx changes only its two vertically centred multi-row merge labels by +0.1366pt, toward the stored golden positions, with unchanged x/width/wraps/fills/100 rectangles; all 20 PDFs pass qpdf --check
  • qpdf --check target/issue-1497/after.pdf
  • fresh Poppler and MuPDF 300-DPI full-page, diff, and matched-crop inspection

Visual impact

  • No rendered PDF change
  • Rendered PDF change or visual evidence added
  • Reason: the page-2 two-line title moves 1.1384pt upward onto Excel's baseline while its x origin, width, line pitch, merged-cell geometry, and every other page element remain unchanged. Page 1 is byte- and layout-identical.

Visual audit

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 --fine-shift PT and dispositioned every fine/large text-instance shift, painted-text visibility mismatch, and visible-fill occlusion
  • Ran compare_render.py --cluster-report PATH --strict-clusters and dispositioned every material 5% fuzz diff cluster by explicit ID
  • Inventoried hairlines and border dash styles
  • Inventoried font weight, italic, and underline emphasis

Deviation audit

Check Result
Page count/order Matches GT
Element presence Matches GT
Position/size Remaining: #1210, #1498, #1499; Fixed #1497
Rotation/flip Matches GT
Fill Matches GT
Stroke/border Matches GT
Shape outline geometry Matches GT
Text content Matches GT
Font family/weight/style Remaining: #1210
Text color Remaining: #1210
Alignment Remaining: #1499; Fixed #1497
Line/paragraph spacing Remaining: #1498
Clipping/overflow Matches GT

GT integrity

  • PDF pages: 2
  • Printable worksheets: 2
  • Hidden worksheets: 1
  • Structural corruption: none observed
  • GT-side font substitution: Arial only; the corrected title uses Century Gothic
  • Source inspection records Century Gothic 30pt in B2:D3 over two declared 49.5pt rows; this corrects the original issue body's 40pt description without changing the measured acceptance target

Checklist

  • Commit includes a Signed-off-by line
  • Mandatory documentation freshness reviewer returned PASS: before commit
  • PR scope contains one root cause
  • Remaining visual deviations each reference an open issue

Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
@developer0hye
developer0hye merged commit a2d16ca into main Sep 2, 2026
34 of 35 checks passed
@developer0hye
developer0hye deleted the fix/issue-1497-merged-title-seat branch September 2, 2026 11:58
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.

XLSX: a two-row merged title block sits 1.14pt below Excel

1 participant