Skip to content

fix(pptx): scale right legend row pitch - #1448

Merged
developer0hye merged 1 commit into
mainfrom
fix/issue-1434-pptx-legend-row-pitch
Aug 31, 2026
Merged

fix(pptx): scale right legend row pitch#1448
developer0hye merged 1 commit into
mainfrom
fix/issue-1434-pptx-legend-row-pitch

Conversation

@developer0hye

Copy link
Copy Markdown
Owner

Summary

Related issue

Fixes #1434

Testing

  • Red first: cargo test -p office2pdf a_powerpoint_column_right_legend_uses_the_native_text_scaled_row_pitch -- --nocapture failed before the implementation with [14.0, 14.0] row pitches instead of the native 19.2pt pitch.
  • cargo test -p office2pdf a_powerpoint_column_right_legend_uses_the_native_text_scaled_row_pitch -- --nocapture — passed; the PowerPoint column/right path is within 0.1pt of 19.2pt and the PowerPoint bar control remains 14pt.
  • cargo test -p office2pdf --lib diagram_visual_tests -- --nocapture — 202 passed.
  • python3 -m unittest discover -s scripts/tests -p 'test_compare_render.py' — 26 passed.
  • python3 -m unittest discover -s scripts/tests -p 'test_compare_layout.py' — 26 passed.
  • python3 -m unittest discover -s scripts/tests -p 'test_check_visual_pr.py' — 42 passed.
  • CARGO_INCREMENTAL=0 cargo clippy --workspace --all-targets -- -D warnings — passed.
  • CARGO_INCREMENTAL=0 cargo test --workspace — core 2,756; DOCX 188; PDF validation 7; PPTX 130; XLSX 206; CLI 17; package/model roundtrip and doctests all passed with zero failures.
  • Rebuilt and converted the fix(docx): honor in-cell picture row floors #1407 PPTX; page 8 legend baselines are 19.152pt apart versus native PowerPoint's 19.2pt.
  • python3 scripts/compare_render.py native-powerpoint.pdf office2pdf.pdf --page 8 --dpi 300 --audit --artifacts-dir ... — all six GT text lines matched; the remaining three >5pt shifts are the shared legend block offsets tracked by PPTX column-chart right legends center 9.2pt too low #1435 and PPTX column-chart right legends are right-fitted 11pt too far left #1436.
  • magick compare -metric AE -fuzz 5% before.png after.png diff.png — 16,447 changed pixels (0.183%), confined to the three legend rows.

Visual impact

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

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 and dispositioned every large text-instance shift and painted-visibility mismatch
  • 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 Matches GT — page 8 is compared against page 8 in both one-page audit extracts
Element presence Matches GT — title, rule, table, chart, axes, legend, footer, and slide number are all present
Position/size Remaining: #1435 and #1436 track the legend block offsets, #1437 tracks the automatic plot rectangle, and #1439 tracks legend-key size
Rotation/flip Matches GT — no rotated or flipped page-8 element differs
Fill Matches GT — table, series, legend-key, footer, and slide-number fills are present with matching colors
Stroke/border Remaining: #1447 tracks the rounded title-rule caps; chart axes, gridlines, and table rules are present
Shape outline geometry Remaining: #1439 tracks the oversized legend-key square outlines
Text content Remaining: #1446 tracks the machine audit's split/joined-line false positives; visible text content matches GT
Font family/weight/style Remaining: #1424 tracks the chart title's missing rich-text weight and style; slide, table, axis, and legend emphasis otherwise matches
Text color Remaining: #1424 tracks the chart title's missing teal text color
Alignment Remaining: #1435 and #1436 track the legend block's vertical and horizontal alignment
Line/paragraph spacing Fixed — the three right-legend baselines now advance by 19.152pt versus native 19.2pt instead of the former 14pt
Clipping/overflow No deviation observed — full-resolution crops show no clipped legend labels, table text, title, or footer

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>
@developer0hye
developer0hye merged commit 236da2b into main Aug 31, 2026
18 checks passed
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 multi-entry right legends use a fixed 14pt row pitch

1 participant