Skip to content

fix(pptx): honor custom geometry transforms - #1520

Merged
developer0hye merged 1 commit into
mainfrom
fix/issue-1418-pptx-title-rule
Sep 4, 2026
Merged

fix(pptx): honor custom geometry transforms#1520
developer0hye merged 1 commit into
mainfrom
fix/issue-1418-pptx-title-rule

Conversation

@developer0hye

@developer0hye developer0hye commented Sep 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • normalize each optional DrawingML custom-path w and h axis independently instead of discarding a declared axis when its peer is absent
  • apply flipH and flipV to normalized custom-path vertices about the shape-box center
  • add focused regressions for a width-only vertically flipped title rule and an independent horizontal flip
  • add fresh 300-DPI GT/before/after evidence plus layout and strict render-cluster reports

The page-9 title rule now reaches the reference endpoint and sits on the reference baseline. The same root-cause correction improves the equivalent flipped rules on pages 5 and 6; the other twelve pages remain pixel-identical before/after.

Related issue

Fixes #1418. Related: #1220, #1419, #1519.

Testing

  • red/green: cargo test --locked -p office2pdf --lib a_single_declared_path_axis_scales_independently -- --nocapture
  • red/green: cargo test --locked -p office2pdf --lib a_custom_geometry_path_follows_shape_flips -- --nocapture
  • red/green: cargo test --locked -p office2pdf --lib a_custom_geometry_horizontal_flip_mirrors_only_x -- --nocapture
  • cargo test --locked -p office2pdf --lib parser::pptx::custom_geometry::tests — 28 passed
  • cargo test --locked -p office2pdf --lib shape_style_tests — 37 passed
  • cargo test --locked --workspace --all-features — passed: 2,856 library tests, 188 DOCX fixtures, 130 PPTX fixtures, 207 XLSX fixtures, CLI/package tests, and doctests; only repository-declared ignores remain
  • cargo clippy --locked --workspace --all-targets --all-features -- -D warnings
  • cargo fmt --all -- --check
  • git diff --check
  • qpdf --check target/issue-1418/after.pdf
  • exact 150-DPI before/after census — only pages 5, 6, and 9 changed; pages 1-4, 7-8, and 10-15 had zero changed pixels
  • GT rectangle traces — page 5 worst title-rule error improved from 120.503pt to 0.035pt, page 6 from 7.072pt to 0.059pt, and page 9 from 11.565pt to 0.055pt
  • mandatory pre-commit documentation freshness audit: PASS

Visual impact

  • No rendered PDF change
  • Rendered PDF change or visual evidence added
  • Reason: Correctly transformed custom paths change the three vertically flipped title rules in the 15-slide fixture.

Visual audit

  • Issue: PPTX page-9 title rule is 11.5pt short and 3.6pt high #1418
  • Fixture: Original GENERAL SERVICES.pptx attachment from PPTX ordinary shape picture fill is omitted from slide 1 #1220, SHA-256 17924ec3b27646a2c1b2bb711b845360b713cc7052b3cdde9df752f9ceded3a9; LibreOffice GT SHA-256 8c8f471d8baaf0abd79e752ef49951c240752d36e4512651f6cb9a7cfffb650f
  • Page(s): 9
  • Renderer and DPI: Poppler pdftoppm at 300 DPI
  • Evidence mode: fix
  • Layout audit report: assets/bugfixes/issue-1418/layout-audit.json
  • Render cluster reports: assets/bugfixes/issue-1418/render-clusters-page-9.json
  • Reference exporter differences: assets/bugfixes/issue-1418/reference-exporter-differences.json
  • Fine-detail threshold: 1.0pt
  • Layout audit page count: Pass
  • Layout audit text flow: ref:page-9-slide-number-visibility
  • 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: Codex inspected the 300-DPI full GT/output/native pages, 5% pixel diff, and matched title-rule, table, and slide-number crops at full resolution. The before rule visibly ended early and sat high; the after rule matches the GT endpoint, vertical seat, color, and thickness. The photo, table fills, timeline bars, text alignment, and clipping remain stable. Native PowerPoint and office2pdf both paint the slide-number glyph and use the source Gill Sans MT Bold title shape; the LibreOffice GT hides the numeral and substitutes Noto Sans. The exact visibility finding and all 20 title-glyph clusters are recorded in the hashed reference-exporter manifest, and the corrected rule creates no material cluster.
  • GT: assets/bugfixes/issue-1418/gt.jpg
  • Before: assets/bugfixes/issue-1418/before.jpg
  • After: assets/bugfixes/issue-1418/after.jpg
  • Native: assets/bugfixes/issue-1418/native.jpg

Visual comparison

GT Before After
GT Before After

Native

  • layout audit: 9/9 painted lines matched; no missing/extra text, wrap/reflow, fill mismatch, large/fine shift, or rectangle geometry finding; the sole visibility finding is ref:page-9-slide-number-visibility
  • page-9 strict report: 20/20 material clusters map to ref:page-9-title-font-native-match; none touches the corrected rule

The page-9 text-layer census has no codepoint-class delta. Its normalized content differs only because the LibreOffice GT carries hidden Sensitivity: Internal metadata; all visible source text is preserved.

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 — both PDFs contain the same 15 slides in source order.
Element presence Reference difference: ref:page-9-slide-number-visibility
Position/size Fixed — the page-9 rule's worst geometry delta is now 0.055pt, below the 0.12pt noise floor; table and image geometry remain stable.
Rotation/flip Fixed — the custom line now follows flipV; no unrelated rotation or flip changed.
Fill Matches GT — background overlay, table cells, timeline bars, circle, and beige rule retain their colors and opacity.
Stroke/border Fixed — the solid beige title rule matches in endpoint, seat, thickness, and dash style; no page-9 element is at or below 1pt, and pages 5-6 checkmark outlines match at 300 DPI.
Shape outline geometry Fixed — the open custom path follows its declared width and shape transform; all other comparable page-9 primitives remain within 0.097pt.
Text content Matches GT — all visible source text is preserved; the LibreOffice PDF alone carries hidden Sensitivity: Internal metadata.
Font family/weight/style Reference difference: ref:page-9-title-font-native-match
Text color Matches GT — visible title, dates, table labels, and rule colors match.
Alignment Matches GT — title, dates, row labels, and timeline bars retain their alignment.
Line/paragraph spacing Matches GT — no wrap, reflow, or material spacing shift remains.
Clipping/overflow Matches GT — full-page and crop inspection found no clipping or overflow.

Checklist

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

@developer0hye

Copy link
Copy Markdown
Owner Author

Exact-head CI run 33811496446 is externally blocked by the newly published tinyvec 1.13.0, not by this diff.

Every failed Cargo job freshly resolved 1.13.0 and stopped inside tinyvec.rs:710 with cannot find macro vec in this scope. The local all-feature workspace run used 1.12.0 from the development lockfile and passed completely; the Visual PR Contract also passed on this exact head (d52ae3d1).

Upstream tracking:

I will rerun this exact head after upstream publishes the correction or yanks 1.13.0.

Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
@developer0hye
developer0hye force-pushed the fix/issue-1418-pptx-title-rule branch from d52ae3d to 0ffd0a5 Compare September 4, 2026 03:58
@developer0hye
developer0hye merged commit 1579ecc into main Sep 4, 2026
25 of 35 checks passed
@developer0hye
developer0hye deleted the fix/issue-1418-pptx-title-rule branch September 4, 2026 04:17
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.

PPTX page-9 title rule is 11.5pt short and 3.6pt high

1 participant