fix(pptx): retain fractional text-story origins - #1586
Merged
Conversation
Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Preserve fractional text-box origins when seating top-anchored PowerPoint
paragraphs. A frame at 144pt with a 3.6pt inset now retains its 147.6pt story
origin: the lecture heading moves from 163pt to 162.6pt (native: 162.48pt),
and later paragraphs and bullets follow the same local grid. All affected
paragraph starts agree with native within 0.12pt.
Native quarter-point translation probes distinguish story-relative rounding
from page rounding. The fix captures the story origin for top anchors and
passes it through the existing paragraph and marker helpers. Typst still
chooses wrapping and layout height.
Related issue
Related: #1583. Remaining independent defects: #1581, #1582, #1584.
The separate physical-line rounding defect in #1584 remains visible after
correcting paragraph origins: product continuations move from −0.16pt to
+0.44pt and from −0.28pt to −0.68pt relative to native. This PR records those
residuals explicitly and keeps the root causes separate.
Testing
cargo test --locked --workspace --no-fail-fast: passed (3485 tests; 15 ignored).cargo clippy --locked --workspace --all-targets -- -D warnings: passed.cargo fmt --all -- --checkandgit diff --check: passed.two embedded font families/sizes, and 0.25/0.50/0.75pt translations.
codepoints, identical codepoint census).
Visual impact
Visual audit
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; concatenated in that order. Full mapping and hashes:assets/bugfixes/issue-1583/README.md.fixassets/bugfixes/issue-1583/layout-audit.jsonassets/bugfixes/issue-1583/render-clusters-page-1.json,assets/bugfixes/issue-1583/render-clusters-page-2.json,assets/bugfixes/issue-1583/render-clusters-page-3.json,assets/bugfixes/issue-1583/render-clusters-page-4.json,assets/bugfixes/issue-1583/render-clusters-page-5.json,assets/bugfixes/issue-1583/render-clusters-page-6.json,assets/bugfixes/issue-1583/render-clusters-page-7.json,assets/bugfixes/issue-1583/render-clusters-page-8.json,assets/bugfixes/issue-1583/render-clusters-page-9.json,assets/bugfixes/issue-1583/render-clusters-page-10.json,assets/bugfixes/issue-1583/render-clusters-page-11.jsonassets/bugfixes/issue-1583/gt.jpgassets/bugfixes/issue-1583/before.jpgassets/bugfixes/issue-1583/after.jpgVisual comparison
Each image contains the eleven full pages in collection order.
Required inspection
Deviation audit
Checklist
Signed-off-byline