Skip to content

fix(pptx): round wrapped lines on the text story grid - #1587

Merged
developer0hye merged 1 commit into
mainfrom
fix/issue-1584-line-rounding
Sep 6, 2026
Merged

fix(pptx): round wrapped lines on the text story grid#1587
developer0hye merged 1 commit into
mainfrom
fix/issue-1584-line-rounding

Conversation

@developer0hye

Copy link
Copy Markdown
Owner

Summary

Round each wrapped PowerPoint line's running baseline within its text story,
retaining the fractional phase until that line is painted. Startup continuation
lines now match native PowerPoint within 0.12pt; product continuations move from
179.0/223.0pt to 178.6/223.6pt (native: 178.56/223.68pt).

Use each physical line's largest font size when restoring mixed-size baseline
seats. Native 90% and 100% spacing probes agree within 0.103pt. Move bullets,
links, and underlines with their associated lines while preserving Typst's
wrapping and layout heights, paragraph-end font handling, and fractional
story origins. Top, center, and bottom anchors are covered.

Related issue

Related: #1584. Remaining independent defects: #1581 and #1582.

Testing

  • cargo test --locked --workspace --no-fail-fast: passed (3487 tests; 15 ignored).

  • All 87 fixed-page text-box tests passed, including RED/GREEN physical-line
    rounding and mixed-size regressions using embedded fonts.

  • Link/underline line-seating regression passed with independent line movements.

  • cargo clippy --locked --workspace --all-targets -- -D warnings: passed.

  • cargo fmt --all --check and git diff --check: passed.

  • Thirteen-page native comparison: layout audit passes at 0.5pt; searchable
    text matches (2,184 normalized codepoints, identical codepoint-class census).

  • All thirteen strict cluster reports pass; 27 clusters have explicit dispositions.

Visual impact

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

Visual audit

  • Issue: PPTX: wrapped continuation baselines retain unsnapped fractional line offsets #1584
  • Fixture: Four public PPTX fixtures under tests/golden_mocks/business/sources/pptx/: 01_startup_pitch_en.pptx, 03_product_launch_en.pptx, 08_marketing_report_en.pptx, 09_lecture_ko.pptx, followed by startup slide 2 center/bottom anchor probes. Mapping, reproduction, and hashes: assets/bugfixes/issue-1584/README.md.
  • Page(s): 1-13
  • Renderer and DPI: pdftoppm, 150 DPI; native PowerPoint 16.112.3 GT
  • Evidence mode: fix
  • Layout audit report: assets/bugfixes/issue-1584/layout-audit.json
  • Render cluster reports: assets/bugfixes/issue-1584/render-clusters-page-1.json, assets/bugfixes/issue-1584/render-clusters-page-2.json, assets/bugfixes/issue-1584/render-clusters-page-3.json, assets/bugfixes/issue-1584/render-clusters-page-4.json, assets/bugfixes/issue-1584/render-clusters-page-5.json, assets/bugfixes/issue-1584/render-clusters-page-6.json, assets/bugfixes/issue-1584/render-clusters-page-7.json, assets/bugfixes/issue-1584/render-clusters-page-8.json, assets/bugfixes/issue-1584/render-clusters-page-9.json, assets/bugfixes/issue-1584/render-clusters-page-10.json, assets/bugfixes/issue-1584/render-clusters-page-11.json, assets/bugfixes/issue-1584/render-clusters-page-12.json, assets/bugfixes/issue-1584/render-clusters-page-13.json
  • Reference exporter differences: None
  • Fine-detail threshold: 0.5pt
  • 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; independent residuals remain tracked in PPTX: multiplication sign disables advance-grid rounding for the entire Latin run #1581 and PPTX: word-level width rounding drops kerning across spaces #1582.
  • Model vision findings: Full pages, pixel diffs, and full-scale bands confirm corrected startup/product continuation positions, unchanged wrapping and markers, and preserved top/center/bottom placement. Korean bold/regular emphasis, chart axes, ticks, gold bar edges, and legend outline remain intact. Pages 2, 6, 11, 12, and 13 were freshly inspected; the other eight pages have identical decoded GT/output/diff/band pixels to the fully inspected PPTX: top-anchored text snaps to page coordinates instead of its text-box origin #1583 comparison. The remaining 17 page-5 suffix clusters and seven page-9 horizontal-drift clusters are tracked in PPTX: word-level width rounding drops kerning across spaces #1582 and PPTX: multiplication sign disables advance-grid rounding for the entire Latin run #1581. One gold legend-edge resampling cluster and two regular Korean glyph-edge rasterization clusters retain matching geometry and emphasis.
  • GT: assets/bugfixes/issue-1584/gt.jpg
  • Before: assets/bugfixes/issue-1584/before.jpg
  • After: assets/bugfixes/issue-1584/after.jpg
  • Native: None
  • Compare: assets/bugfixes/issue-1584/compare.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: thirteen pages in documented fixture/probe order.
Element presence Matches GT: titles, body lines, markers, shapes, and pictures remain present.
Position/size Remaining: #1581 and #1582; separate Latin advance-grid and cross-space kerning defects.
Rotation/flip Matches GT.
Fill Matches GT: covers, cards, bars, and Korean panel retain colors.
Stroke/border Matches GT: chart axes, ticks, gold bar edges, and legend outline remain present.
Shape outline geometry Matches GT: no material matched rectangle or outline deviation.
Text content Matches GT: searchable text and codepoint-class census match.
Font family/weight/style Matches GT: regular bodies, bold titles, and Korean emphasis remain intact.
Text color Matches GT.
Alignment Matches GT: story anchors and paragraph starts are preserved.
Line/paragraph spacing Fixed: each continuation uses the running story grid and its own font-size seat; wrapping and paragraph layout height are unchanged.
Clipping/overflow No deviation observed.

Checklist

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

Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
@developer0hye
developer0hye merged commit 391c1d1 into main Sep 6, 2026
18 checks passed
@developer0hye
developer0hye deleted the fix/issue-1584-line-rounding branch September 6, 2026 03:50
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