Scale Unicode box drawing characters to eliminate rendering gaps#56
Conversation
…e visual gaps. This commit updates both the GIF and SVG renderers to identify unicode characters falling into the Box Drawing, Block Elements, and Symbols for Legacy Computing (and Supplement) blocks. When these characters are encountered, they are explicitly stretched via explicit X and Y scaling factors so that they fully occupy the cell bounding box. This prevents visual gaps from appearing between adjacent block characters when custom line heights or letter spacing are used. The glyph cache key in the GIF renderer was updated to account for varying scaling factors in X and Y independently. Tests were also added to verify the `is_box_drawing` function accurately categorizes the character points. Co-authored-by: HalFrgrd <4559349+HalFrgrd@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
This submission fixes rendering gaps between adjacent Unicode box drawing characters, block elements, and symbols for legacy computing.
When users configured stretched line heights or custom letter spacing, these characters failed to connect, resulting in an unpolished appearance. This update introduces an
is_box_drawingutility function to identify characters from these blocks (U+2500-259F,U+1FB00-1FBFF,U+1CC00-1CEBF). In the GIF renderer, these characters are explicitly scaled to exactly match the cell width and height. In the SVG renderer, similar behavior is achieved by separating box drawing text strings and applyingtextLengthwithlengthAdjust="spacingAndGlyphs"for horizontal coverage and atransform="scale(...)"for vertical coverage relative to the character's center. Tests have been included, and all format, clippy, and unit tests pass.PR created automatically by Jules for task 1968457611416342355 started by @HalFrgrd