Skip to content

feat(xlsx): print row and column heading gutters when printOptions asks - #723

Merged
developer0hye merged 1 commit into
mainfrom
fix/xlsx-print-headings
Jul 30, 2026
Merged

feat(xlsx): print row and column heading gutters when printOptions asks#723
developer0hye merged 1 commit into
mainfrom
fix/xlsx-print-headings

Conversation

@developer0hye

@developer0hye developer0hye commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Summary

<printOptions headings="1"/> prints Excel's row-number gutter and column-letter strip; the attribute was never read, so both gutters were missing from every page.

Measured off the native Excel GT (both NumberFormatTests sheets, agreeing across Letter/A4 and 1-vs-3-digit row counts): the gutter is a fixed 22pt interior + 1pt black separator (it does not scale with digit count), the strip 12pt + separator; heading cells are unfilled with constant-#565656 1pt rules between them (the PDF "gradients" are degenerate single-colour shadings); a 1pt black frame encloses the block on every page, shrinking to content on the partial last page; digits/letters are the Normal font, regular, centred horizontally, seated 3pt above the band bottom.

Implementation materialises the gutter as a real prepended column (row numbers flow with Typst pagination, width packing, merges and drawings by construction) and the strip as rows[0] re-emitted as a repeating header above print-title rows. The strip's bottom boundary joins the repeating-header tie rules (a body top border cannot strip it from pages 2+); gridline seeding (#622) skips the frame-owned exterior; width pagination packs the first column group against the full printable width; non-left-anchored print-title columns keep their repeat (gutter yields on overflow pages — Excel repeats both; TODO documents the multi-range requirement).

Related issue

Fixes #623

Testing

  • cargo test --workspace — green (2100+ tests; ~25 new red-first tests across scanner, heading materialisation, base-26 letters, pagination slices, codegen repeat blocks, frame bands, descender seat, tie adoption, DOCX/PPTX guards)
  • cargo +1.97 clippy --workspace --all-targets — clean; cargo fmt --check — clean
  • GT parity: separator/frame bands on GT's exact boundaries; heading baselines within 0.10pt of the measured seat; row numbers continue to 337 across pages; letters + top frame edge repeat on every flowed page

Visual impact

  • No rendered PDF change
  • Rendered PDF change or visual evidence added
  • Reason:

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
  • Inspected matched region crops at full resolution
  • Ran the 5% fuzz pixel-difference sweep
  • Inventoried hairlines and border dash styles
  • Inventoried font weight, italic, and underline emphasis

Deviation audit

Check Result
Page count/order Remaining: #658 — 12pt vs GT 13pt rows; Remaining: #717 — A4 vs GT's schema-default Letter; sheet order matches
Element presence Fixed — gutter, letter strip, corner box, inter-heading rules and the outer frame are all present (before: entirely absent); Remaining: #718 — the formatted empty column E and its letter are absent
Position/size Remaining: #722 — intermediate Typst-flowed pages leave the gutter's bottom frame span open; Remaining: #658 — gutter rule pitch follows the 12pt row track. The heading geometry this PR adds matches GT (22pt+1pt gutter, 12pt+1pt strip, separators at identical device positions)
Rotation/flip No deviation observed
Fill Matches GT — heading bands and corner unfilled white; body header band identical
Stroke/border Fixed — black separators, gray #565656 inter-heading rules, and the outer frame land on GT's bands; Remaining: #722 — the intermediate-page bottom frame gap over the gutter span
Text content Fixed — row numbers and letters present and correct; Remaining: #719 — body cells drop xml:space leading spaces
Font family/weight/style Matches GT — regular-weight Normal font digits/letters, ink heights within 1px
Text color Matches GT — black
Alignment Fixed — digits centred and bottom-seated within 0.10pt of GT's 3pt seat; Remaining: #657 — body-cell left inset 1pt narrow
Line/paragraph spacing Remaining: #658 — 12pt vs 13pt row pitch
Clipping/overflow No deviation observed

Checklist

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

🤖 Generated with Claude Code

<printOptions headings="1"/> prints Excel's row-number gutter and
column-letter strip beside the grid. The attribute was never read, so
both gutters were missing from every page.

Measured off the native Excel GT of NumberFormatTests (both sheets set
the flag; both page sizes and 1-vs-3-digit row counts agree): the
gutter is a fixed 22pt interior plus a 1pt black separator — it does
not scale with digit count — and the strip 12pt plus its separator.
Heading cells are unfilled; the rules between them are 1pt bands of
constant #565656 (the PDF's 'gradient' shadings are degenerate
single-colour functions), black between headings and data, and a 1pt
black frame encloses the whole block on every page, shrinking to
content on the partial last page. Digits and letters are the Normal
font, regular weight, centred horizontally and seated on a baseline
3pt above the band bottom — Excel's ordinary bottom seat.

The gutter is materialised as a real prepended column, so row numbers
flow with Typst pagination, width packing, merges and drawings by
construction; the strip is rows[0], re-emitted as a repeating header
above print-title rows so every page carries letters, its bottom
separator, and the frame's top edge. The strip's bottom boundary joins
the repeating-header tie rules so a body top border cannot strip it
from pages 2+, gridline seeding skips the frame-owned exterior, width
pagination now packs the first column group against the full printable
width, and non-left-anchored print-title columns keep their repeat
(gutter yields; Excel repeats both — TODO with the multi-range reason).

Verified against GT: separator and frame bands land on GT's exact
boundaries, heading baselines within 0.10pt of the measured seat, row
numbers continue to 337 across pages, letters repeat on every page.
The one remaining frame gap — Typst-chosen page breaks leave the
gutter's bottom span open on intermediate pages — is tracked in #722.

Related: #623

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
@developer0hye
developer0hye merged commit 4895173 into main Jul 30, 2026
32 of 33 checks passed
@developer0hye
developer0hye deleted the fix/xlsx-print-headings branch July 30, 2026 14: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.

XLSX: printOptions headings="1" is ignored, so the row-number and column-letter gutters never print

1 participant