fix(xlsx): seat category labels using native font metrics - #1576
Merged
Conversation
Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
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
Place explicitly sized worksheet line/area category labels using the measured font ascent, descent, and leading, the actual plot bottom, and the available chart height. The old automatic label band placed the budget workbook's month labels too high and did not follow shorter manual plots. Native one-factor font-size, font-family, plot-height, and fractional-frame-height probes distinguish the natural baseline from its bottom cap and the order of rounding.
The calibrated Calibri/Avenir metrics retain their source line gap when a runner uses a substitute font.
Related: #1568. The shared chart-origin offset remains tracked in #1542.
Testing
Baseline:
f0071d9ea88b71d33f4e5ba8fc2fc30ad206c099, including the separate axis-font and boundary-space fixes. Fixture SHA-256:2b4a2d8dceda58758593c88409875efbda05780559154c02bd13fef4f7a1c65b; Cargo.lock SHA-256:750f50c507b281f84b945b09573333ffa02dc45cddd566481af8535ae101e612.Reproduce conversion with
cargo run --locked -p office2pdf-cli -- tests/fixtures/xlsx/issue_1181_fit_to_height.xlsx -o output.pdf --font-path '/Applications/Microsoft Excel.app/Contents/Resources/DFonts'. Compare both pages usingscripts/compare_layout.py GT.pdf output.pdf --audit --fine-shift 0.5 --json, andscripts/compare_render.py GT.pdf output.pdf --page P --dpi DPI --fine-shift 0.5 --cluster-report PATH --cluster-dispositions PATH --strict-clusters(150 DPI page 1, 300 DPI page 2).Visual impact
Visual audit
tests/fixtures/xlsx/issue_1181_fit_to_height.xlsx(SHA-2562b4a2d8dceda58758593c88409875efbda05780559154c02bd13fef4f7a1c65b)fixassets/bugfixes/issue-1568/layout-audit.jsonassets/bugfixes/issue-1568/render-clusters-page-1.json,assets/bugfixes/issue-1568/render-clusters-page-2.jsonassets/bugfixes/issue-1568/gt.jpgassets/bugfixes/issue-1568/before.jpgassets/bugfixes/issue-1568/after.jpgVisual comparison
Native Excel 16.112.3 exports, verified Excel/Quartz PDF provenance. Page 2 at 300 DPI:
The unchanged page-1 native comparison is attached to #1550, #1551, and #1552.
Required inspection
Deviation audit