Skip to content

fix(docx): seat bottom-anchored footer text - #1451

Merged
developer0hye merged 1 commit into
mainfrom
fix/issue-1370-docx-footer-text-box-baseline
Aug 31, 2026
Merged

fix(docx): seat bottom-anchored footer text#1451
developer0hye merged 1 commit into
mainfrom
fix/issue-1370-docx-footer-text-box-baseline

Conversation

@developer0hye

Copy link
Copy Markdown
Owner

Summary

  • Seat the DOCX footer WPS text box sits 8pt too low #1370 page-bottom WPS footer text one final-line em above its declared bottom inset, matching the supplied reference.
  • Derive that em from the last measurable paragraph, including the renderer's 11pt default, instead of hard-coding the 8pt reference case.
  • Add an end-to-end PDF baseline regression at both 8pt and 12pt plus fresh two-page visual evidence.

Related issue

Fixes #1370

Testing

  • TDD red: CARGO_TARGET_DIR=/Volumes/T7/targets/office2pdf-issue-1370 cargo test -p office2pdf --lib a_bottom_seated_anchored_frame_keeps_one_em_above_its_bottom_inset -- --nocapture failed before the implementation: bottom-seated 8pt baseline 826.89pt should be 818.89pt.
  • CARGO_TARGET_DIR=/Volumes/T7/targets/office2pdf-issue-1370 cargo test -p office2pdf --lib a_bottom_seated_anchored_frame_keeps_one_em_above_its_bottom_inset -- --nocapture (1 passed; 8pt, 12pt, and unstated/11pt-default PDF probes)
  • CARGO_TARGET_DIR=/Volumes/T7/targets/office2pdf-issue-1370 cargo test -p office2pdf --lib render::typst_gen::tests::page_misc_tests -- --nocapture (79 passed)
  • CARGO_TARGET_DIR=/Volumes/T7/targets/office2pdf-issue-1370 cargo test -p office2pdf --lib parser::docx::sections::anchor_tests -- --nocapture
  • CARGO_TARGET_DIR=/Volumes/T7/targets/office2pdf-issue-1370 cargo test --workspace
  • python3 -m unittest discover -s scripts/tests (266 passed)
  • cargo fmt --all -- --check
  • git diff --check
  • Reconverted the Place your event title here.docx #1219 attachment from the final source; the resulting PDF is byte-identical to the visually audited after PDF (8d9423e06d25bc27393d6fe484d3febcbbedc9ff71d72cd07b708bffe434b2d4).
  • python3 scripts/compare_layout.py --json --audit gt.pdf after.pdf (expected nonzero; remaining findings dispositioned to DOCX missing-font selection changes table wrapping and placement across hosts #1409 and Harness: detect text occluded by clipped opaque shadings #1450)
  • python3 scripts/compare_render.py --page 1 --dpi 300 --audit --lines --artifacts-dir ... gt.pdf after.pdf and page 2 equivalent (expected nonzero; remaining text shifts dispositioned to DOCX missing-font selection changes table wrapping and placement across hosts #1409)
  • Documentation freshness audit: PASS

Visual impact

  • No rendered PDF change
  • Rendered PDF change or visual evidence added
  • Reason: the visible page-2 footer baseline moves up by 8pt; the same page-1 text remains correctly occluded behind body artwork.

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: two pages in the same order, with the RSVP page second
Element presence Remaining: #1409 tracks the missing/extra line segmentation; all source elements and both footer text-layer instances remain present
Position/size Remaining: #1409 tracks title, subtitle, ALL, AGES, gate, and RSVP shifts; the page-2 footer baseline is fixed to within 0.05pt of GT
Rotation/flip Matches GT: the rotated photo and transformed decorations keep their orientation
Fill Matches GT: the blue/pink gradients and solid decorations remain present at high DPI
Stroke/border Matches GT: the white circle/arc, three outlined triangles, and white rules retain their hairline strokes; there are no dashed stroke styles, and the dot fields are filled circles
Shape outline geometry Matches GT: matched crops show the diamond, circle, triangles, polygon, photo boundaries, and three vertical bars unchanged
Text content No deviation observed: all source text remains extractable, including the visually occluded page-1 footer
Font family/weight/style Remaining: #1409 tracks host-dependent title and body font family/weight metrics; bold title and gate emphasis remain present, with no italic or underlined runs in the fixture
Text color Matches GT: text remains black on both pages
Alignment Remaining: #1409 tracks font-metric-driven body alignment; the footer's vertical seat is fixed
Line/paragraph spacing Remaining: #1409 tracks title and WELCOME line grouping plus the measured text shifts
Clipping/overflow Remaining: #1409 tracks the output's three-line WELCOME overflow versus GT's four-line wrap; #1450 tracks the audit harness's false visibility classification for the correctly occluded page-1 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 120c1ef 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.

DOCX footer WPS text box sits 8pt too low

1 participant