fix(docx): style PAGE and NUMPAGES fields from their run#458
Merged
Conversation
Word applies the containing run's properties to a field result, so a footer written as an 8 pt gray run with a `PAGE` field prints the number at 8 pt gray. office2pdf dropped the run properties and fell back to the document default, printing the number at roughly 11 pt black and inflating the footer's line box. Carry the run's `TextStyle` on the field IR variants and emit the counter under those properties. Fixes #450 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
TextStyleon thePAGEandNUMPAGESfield IR variants and render the counter under those properties.Related issue
Fixes #450
Testing
cargo test --workspace(1832 tests, all pass)cargo clippy --workspace --all-targets(clean)cargo fmt --checkpdftotext -bboxon the page-1 footer of05_technical_manual_enagainst the Word PDFpdftoppm -r 150plus a 300% crop of the footer linemagick compare -metric AE -fuzz 5%on the size-normalized pagePage-1 footer glyph boxes:
-literal1fieldIn Word every glyph on the footer line shares one box. Before the fix the field's box was 12.54 pt against the literals' 7.51 pt; after, all three match.
Visual impact
Visual audit
fixassets/bugfixes/issue-450/gt.jpgassets/bugfixes/issue-450/before.jpgassets/bugfixes/issue-450/after.jpgVisual comparison
Required inspection
Deviation audit
F4F4F4code-block shading is presentCCCCCCheader rule is present at itsw:spaceoffset888888instead of blackChecklist
Signed-off-byline