Skip to content

fix(pptx): round hard-break seats per line - #1523

Merged
developer0hye merged 1 commit into
mainfrom
fix/issue-1252-hard-break-seat
Sep 4, 2026
Merged

developer0hye merged 1 commit into
mainfrom
fix/issue-1252-hard-break-seat

Conversation

@developer0hye

@developer0hye developer0hye commented Sep 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • evaluate PowerPoint's rounded hard-break seat at each physical line's own maximum font size
  • preserve the existing paragraph-relative model when explicit line spacing is present
  • add exact mixed-size regression coverage plus a minimal native PowerPoint fixture and strict visual evidence

Related issue

Related: #1252

Testing

  • cargo test --locked --workspace
  • CARGO_TARGET_DIR=/private/tmp/office2pdf-1252-check cargo check --locked --workspace
  • CARGO_TARGET_DIR=/private/tmp/office2pdf-1252-check cargo clippy --locked --workspace --all-targets -- -D warnings
  • cargo fmt --all -- --check
  • focused hard-break unit tests (6 passed), fixture smoke test, and native PowerPoint PDF comparison
  • python3 scripts/compare_layout.py /private/tmp/office2pdf-1252-visual.aQu2pO/gt-isolated.pdf /private/tmp/office2pdf-1252-visual.aQu2pO/after-isolated.pdf --json --audit --fine-shift 0.12
  • python3 scripts/compare_render.py /private/tmp/office2pdf-1252-visual.aQu2pO/gt-isolated.pdf /private/tmp/office2pdf-1252-visual.aQu2pO/after-isolated.pdf --page 1 --dpi 300 --artifacts-dir /private/tmp/office2pdf-1252-visual.aQu2pO/audit-isolated-page-1 --cluster-report assets/bugfixes/issue-1252/render-clusters-page-1.json --strict-clusters
  • magick compare -metric AE -fuzz 5% (before: 14,024 pixels; after: 12,754 pixels versus GT)

Visual impact

  • No rendered PDF change
  • Rendered PDF change or visual evidence added
  • Reason: Mixed-size hard-broken PPTX paragraphs now use PowerPoint's per-line rounded seat.

Visual audit

  • Issue: PPTX: a hard break between two sizes seats the following line on the paragraph's split, not on its own size #1252
  • Fixture: tests/fixtures/pptx/hard_break_mixed_size_seat.pptx
  • Page(s): 1
  • Renderer and DPI: native Microsoft PowerPoint GT export; Poppler pdftoppm, 300 DPI
  • Evidence mode: fix
  • Layout audit report: assets/bugfixes/issue-1252/layout-audit.json
  • Render cluster reports: assets/bugfixes/issue-1252/render-clusters-page-1.json
  • Reference exporter differences: None
  • Fine-detail threshold: 0.12pt
  • Text-layer-only: No
  • Pixel delta: 5,056 pixels between before and after at 5% fuzz
  • Layout audit page count: Pass
  • Layout audit text flow: Pass
  • Layout audit visible fills: Pass
  • Layout audit rectangle geometry: Pass
  • Layout audit large shifts: Pass
  • Layout audit fine shifts: Pass
  • New follow-up issues found in this audit: None
  • Model vision findings: Full-page, diff, and full-resolution crop inspection shows the bold Arial caption and all nine alternating 20pt/10pt lines present and aligned. The prior small-line baseline offset is gone; the after page matches GT within 0.08pt, with only dispersed glyph-edge rasterization in the diff and no material clusters. No clipping, border, fill, rotation, or emphasis mismatch remains.
  • GT: assets/bugfixes/issue-1252/gt.jpg
  • Before: assets/bugfixes/issue-1252/before.jpg
  • After: assets/bugfixes/issue-1252/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 --fine-shift PT and dispositioned every fine/large text-instance shift, rectangle geometry deviation, 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: one page in the same order.
Element presence Matches GT: the caption and all nine body lines are present.
Position/size Fixed: small-line baseline errors up to 0.46pt are removed; worst after baseline delta is 0.08pt and worst text-width delta is 0.163%.
Rotation/flip No deviation observed: the fixture has no rotated or flipped content.
Fill Matches GT: black text on the white slide background.
Stroke/border No deviation observed: the fixture contains no visible strokes, borders, dash styles, or hairlines.
Shape outline geometry No deviation observed: the text boxes have no visible outline, and the matched page rectangle agrees within 0.00001pt.
Text content Matches GT: normalized text and all ten visible lines are identical.
Font family/weight/style Matches GT: Arial is preserved; the caption is bold and all body runs are regular, with no italic or underline runs.
Text color Matches GT: all visible text is black.
Alignment Matches GT: caption and body lines remain left aligned.
Line/paragraph spacing Fixed: each 20pt/10pt hard-break line now uses its own whole-point seat; all ten baselines match GT within 0.08pt.
Clipping/overflow No deviation observed: every glyph is fully visible inside the slide.

Checklist

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

@developer0hye

Copy link
Copy Markdown
Owner Author

Exact-head CI run 33821140488 is blocked by the known upstream tinyvec 1.13.0 regression: dependency compilation fails at tinyvec.rs:710 because the vec! macro is not in scope. The failure occurs before this PR's Rust checks/tests can run.

The commit-local gates that do not compile that dependency are green: DCO, Format, Release Automation Contract, Business Golden Contract, and Visual PR Contract. Local cargo test --locked --workspace, isolated check/clippy, and the strict visual audit passed against 6f07d5cbe12e3c3a4fc15a754c47298e0f5cea96 using the pinned pre-regression graph.

Upstream fix: Lokathor/tinyvec#226. This PR will remain unmerged until the consumer graph is healthy and exact-head CI is rerun.

PowerPoint rounds a hard-broken line's seat at that line's own font size. Reusing a paragraph-wide split from the largest run rescaled smaller lines to fractional seats and shifted mixed-size stacks.

Evaluate the validated PowerPoint split independently for each plain hard-break line while preserving explicit paragraph line-spacing behavior. Add a native PowerPoint fixture, exact regression coverage, and strict visual evidence for issue #1252.

Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
@developer0hye
developer0hye force-pushed the fix/issue-1252-hard-break-seat branch from 6f07d5c to 83a6da1 Compare September 4, 2026 04:38
@developer0hye
developer0hye merged commit fe096d2 into main Sep 4, 2026
18 checks passed
@developer0hye
developer0hye deleted the fix/issue-1252-hard-break-seat branch September 4, 2026 04: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.

1 participant