fix(xlsx): cap a line legend key's marker at six tenths of the legend font size - #1752
Merged
Merged
Conversation
… font size A line series' legend key drew the series' declared marker size whatever the legend's font size, so a 6pt worksheet legend carried the 5pt plot marker where native Excel prints 3pt, and the 5pt sample box outgrew the 6pt line box and pushed that entry's label a printed point below the column labels on its row. Native Excel for Mac 16.112 one-factor exports of the public gift-budget workbook (a 24pt declared marker under legend sizes 6 to 18pt on Segoe UI and Verdana, plus declared markers 2 to 12 at 9pt and 2 to 7 at 6pt) show the key marker is min(declared, floor(0.6 x legend size)), independent of the face: the painted key rectangle is 5.985pt on Segoe UI and 5.470pt on Verdana at 10pt while the marker is 6pt on both. The plotted markers keep their declared size in every export. The legend key now takes the legend text size, draws the plot's marker at that allowance, and sizes its sample box at min(5pt, allowance) so ordinary-size legends keep their calibrated seat. The 9pt fixture output is byte-identical. Evidence for the fixed 6pt page (assets/bugfixes/issue-1617) reuses the #1616 cluster dispositions by identical ID; the 2.0pt native sample stroke at 6pt is filed as #1751 with its compare image. Probe specs and the measured native rows are recorded under assets/validation/issue-1617. Related: #1617, #1751, #1618, #1748. 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 line series' legend key drew the series' own marker at the declared
c:marker/c:sizewhatever the legend's font size, so the 6pt bottom legend of the public Gift Budget workbook carried a 5pt disc (4.10 printed points) where native Excel prints 3pt (2.46), and the 5pt sample box outgrew the 6pt line box and pushed theAmount Spentlabel 1.06 printed points below the three column labels.Native Excel for Mac 16.112 one-factor exports (the series declaring a 24pt marker under legend sizes 6, 7, 8, 9, 10, 11, 12, 14 and 18pt on Segoe UI and 6, 8, 10, 12 and 14pt on Verdana; declared markers 2, 3, 5, 7 and 12 at 9pt and 2, 4, 5 and 7 at 6pt; each batch against a layout-identical re-zip control) show that the key marker is the declared size capped at
floor(0.6 x legend size), face-independent: 3, 4, 4, 5, 6, 6, 7, 8, 10 chart points. The painted key rectangle (0.45 x the face's hhea box) is not the cap — at 10pt it is 5.985pt on Segoe UI and 5.470pt on Verdana while the marker is 6pt on both. Declared sizes under the allowance pass through, and the plotted markers keep their declared size in every export.line_legend_keynow takes the legend text size, draws the plot's marker atmin(declared, legend_marker_cap_pt(size)), and sizes its sample box atmin(SERIES_MARKER_SIZE_PT, cap)so the box shrinks with the allowance but never grows past the 5pt the key's baseline offset is calibrated against.series_marker_markuptakes the size as a parameter; the plot passes the declared size through the newseries_marker_size_pt. The 9pt fixture output is byte-identical before and after.On the 6pt package the key marker now measures 3.0 x 3.0 chart points (2.46 printed) against native 3.0 x 3.0, and all four legend labels share one baseline as native does.
Related: #1617. The disc's whole-point origin within the sample is #1618; the row's one-chart-point seat is #1748; the 2.0pt native sample stroke at 6pt is #1751, filed from this audit with
assets/bugfixes/issue-1751/compare.jpg.Related issue
Fixes #1617
Testing
a_legend_marker_never_exceeds_six_tenths_of_the_legend_font_size,a_declared_marker_below_the_legend_cap_keeps_its_size,a_small_legend_shrinks_the_line_sample_box_with_its_markerandthe_legend_marker_cap_reaches_every_family_that_draws_a_line_keyfail on main (5pt disc at every legend size).declared_marker_paint_reaches_plot_and_legend_across_chart_familiesnow expects the key marker at the legend's allowance while its paint still reaches the key.cargo test --locked -p office2pdf --lib: 3089 passed.cargo test --locked --workspace: all suites passed (office2pdf lib 3124; conversion 189, workspace integration suites green; 0 failed).cargo clippy --locked --workspace --all-targets -- -D warningson stable and 1.97,cargo fmt --all --check,git diff --check: passed.3f40e2a8…):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 unchanged from the XLSX: small-font bottom legends use an incorrect entry-width floor #1616 audit.Visual impact
Visual audit
a:defRPr/@sz900 to 600, the XLSX: small-font legends retain oversized line-series markers #1617 controlled package, rebuilt byassets/validation/issue-1617/marker-size-6pt-probe.json's base)fixassets/bugfixes/issue-1617/layout-audit.jsonassets/bugfixes/issue-1617/render-clusters-page-2.jsonassets/bugfixes/issue-1617/gt.jpgassets/bugfixes/issue-1617/before.jpgassets/bugfixes/issue-1617/after.jpgVisual comparison
Required inspection
Deviation audit
Checklist
Signed-off-byline🤖 Generated with Claude Code