Render dashed-wide, heavy-dash, and diagonal box glyphs in SVG - #4
Merged
Conversation
The SVG CustomGlyphRenderer was missing or mis-drawing several box-drawing glyphs used by the new stacka-ported BoxBorder styles: - Dashed-wide (double-dash) chars in the DashedWide / RoundedDashedWide / HeavyDashedWide borders had no segment-table entry, so they rendered blank. - The Beveled border's diagonals were mapped to LightLeft|LightRight, drawing a horizontal bar through the cell instead of an actual diagonal. - Heavy dashes stroked at the light weight, so they looked thin. Replace the segment-table handling of dashed/diagonal glyphs with two dedicated handlers invoked before the lookup: - TryRenderDashed covers the light/heavy families in 2-, 3-, and 4-dash densities, routing heavy variants through heavyStroke. The dash/gap math generalizes the historical triple-dash pattern (dash = 2*len/(3N-1), gap = dash/2), so existing light triple/quad dash output is byte-identical. - TryRenderDiagonal draws true corner-to-corner strokes for the diagonals. Remove the now-dead dashed/diagonal table entries and the unused DashedHorizontal/DashedVertical enum flags. Verified all 52 distinct glyphs in new-box-borders.md render correctly; full test suite passes (301 + 89).
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.
What
The SVG
CustomGlyphRendererwas missing or mis-drawing several box-drawing glyphs used by the new stacka-portedBoxBorderstyles (new-box-borders.md). This fixes all three gaps so every one of the 17 new border sets renders correctly.╌ ╎ ╍ ╏(DashedWide / RoundedDashedWide / HeavyDashedWide)stroke-dasharrayline╱ ╲(Beveled)LightLeft|LightRight→ drew a horizontal bar┅ ┇ ┉ ┋(HeavyDashed / HeavyDotted)lightStroke→ drew thinheavyStrokeHow
TryRenderDashed(light + heavy families in 2-, 3-, and 4-dash densities) andTryRenderDiagonal(╱ ╲ ╳), both invoked before the segment lookup.dash = 2*len/(3N-1),gap = dash/2— so existing light triple/quad-dash output is byte-identical.DashedHorizontal/DashedVerticalenum flags.Testing
new-box-borders.md:ok=52 blank=0 bad=0, with diagonal and heavy-weight assertions passing.