fix(xlsx): advance bottom-legend entries by the row's measured clearance without a width floor - #1750
Merged
Merged
Conversation
…nce without a width floor A worksheet axis chart's bottom legend held every entry at the 78pt LEGEND_ENTRY_W floor and skipped the visible-row trim and centre shift when the last entry fell under it, so the 6pt legend of the public Gift Budget workbook started 12.27 printed points left of native with a flat 78pt pitch where native advances 77.23 and 75.50pt. Native Excel for Mac 16.112 one-factor exports of the same workbook (all four series renamed to one string at twelve widths at 9pt, five at 6pt and four at 18pt, plus the unchanged row at 6, 9 and 18pt) show that an entry advances by key + gap + its own label + one clearance shared by the row, 6.617pt + 0.16 x the mean label design advance, with no floor. Twenty-four of the twenty-five rows fit within 0.016pt. The per-face slope table and the terminal-glyph term were this share of each row's mean label width, so both are replaced by the rule; other hosts and unmeasured faces keep the generic gap and the #827 floor. The 6pt package's filled keys now land within 0.02 printed points of native and the 9pt row moves by under 0.006pt. The row's vertical seat at 6pt (#1748), the constrained clearance above 23pt (#1749) and the line-sample box (#1617) are tracked separately. Related: #1616 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
…e table The seven-face gutter table measured each row through the runner's own font resolution; a runner without Century Gothic installed resolves a substitute whose labels are narrower, and the shared-clearance rule then reports that substitute's clearance. Record each source face's design advance of the probe label and skip a face that resolves to another design, keeping the in-tree Calibri row mandatory, as the PowerPoint legend-key face sweep already does. Related: #1616 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.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.
File submission policy
Summary
A worksheet axis chart's bottom legend held every entry at the 78pt
LEGEND_ENTRY_Wfloor and skipped the visible-row trim and centre correction when the last entry fell under it, so the 6pt legend of the public Gift Budget workbook started 12.27 printed points left of native with a flat 78pt pitch where native advances 77.23 and 75.50.Native Excel for Mac 16.112 one-factor exports (all four series renamed to one string at twelve widths at 9pt, five at 6pt and four at 18pt, plus the unchanged four-name row at 6, 9 and 18pt, each against a layout-identical re-zip control) show that an entry advances by key + gap + its own label + one clearance shared by the row,
6.617 + 0.16 x mean(label design advances), with no floor. Twenty-four of the twenty-five rows fit within 0.016pt. The earlier per-face slope table and terminal-glyph term were this share of each row's mean label width, so both are replaced by the rule. The floor and the genericGAPremain for other hosts and unmeasured faces.On the 6pt package the three filled keys now land at 586.967 / 650.277 / 712.172 printed points against native 586.950 / 650.275 / 712.185; the 9pt row moves by under 0.006pt.
Related: #1616. Vertical seat of the 6pt row is #1748; the constrained clearance above 23pt is #1749; the line-sample box is #1617.
Related issue
Fixes #1616
Testing
an_excel_legend_entry_advances_by_its_own_label_with_no_width_floor,an_excel_legend_row_shares_one_clearance_from_its_mean_labeland the compiledgift_budget_compiled_six_point_legend_keys_match_native_boundsfail on main (78pt pitch; first key 574.49 against 586.95).cargo test --locked -p office2pdf --lib: 3085 passed.cargo test --locked --workspace: see the run recorded below.cargo clippy --locked --workspace --all-targets -- -D warningson stable and 1.97,cargo fmt --all --check,git diff --check: passed.compare_layout.py --audit --fine-shift 0.5 --noise-floor 0.5,compare_text_layer.py,compare_render.py --dpi 300 --strict-clusterson page 2; the text-layer census (3 fewer spaces, extraction order) is identical to the pre-fix output.Visual impact
Visual audit
a:defRPr/@sz900 to 600, the XLSX: small-font bottom legends use an incorrect entry-width floor #1616 controlled package; rebuilt in-test and byassets/validation/issue-1616/legend-size-and-label-probe.json)fixassets/bugfixes/issue-1616/layout-audit.jsonassets/bugfixes/issue-1616/render-clusters-page-2.jsonAmount Spentlabel lower still under an oversized marker disc (XLSX: small-font legends retain oversized line-series markers #1617), and Excel's whole-point glyph placement widening its 6pt labels slightly. The 4x crops and a pixel column profile of the Feb-Mar and Aug-Dec segments show native clipping the 2.24pt stroke at the plot's bottom edge under the grey axis while the output paints the full stroke (XLSX: worksheet chart series are not clipped to Excel's whole-point plot rectangle, so a zero-value line paints over the category axis #1745). Every other cluster matches the XLSX: top-aligned wrapped worksheet text starts above the native baseline #1606 audit's crops by bbox.assets/bugfixes/issue-1616/gt.jpgassets/bugfixes/issue-1616/before.jpgassets/bugfixes/issue-1616/after.jpgVisual comparison
Required inspection
Deviation audit
Checklist
Signed-off-byline🤖 Generated with Claude Code