fix: draw Powerline separators as vector geometry and clamp oversized glyphs#185
Open
cunninghamcard-bit wants to merge 1 commit into
Open
fix: draw Powerline separators as vector geometry and clamp oversized glyphs#185cunninghamcard-bit wants to merge 1 commit into
cunninghamcard-bit wants to merge 1 commit into
Conversation
… glyphs Two rendering fixes for prompt "smudge" artifacts in the canvas renderer: 1. Powerline separators (U+E0B0-U+E0B7) are now drawn as exact vector paths filling the cell box instead of font glyphs. Font rasterization leaves anti-aliasing fringe on the diagonals and sub-cell ink height, so the background bleeds through above/below the glyph — with powerline-heavy prompts (starship segments) this reads as smudged, banded segment edges. WezTerm and xterm.js (customGlyphs) special-case these codepoints for the same reason. 2. fillText now passes the cell's allocated width as maxWidth. Glyphs served by fallback fonts (Nerd icons, emoji, symbols) often carry an advance wider than the cell measured from the primary font; unclamped ink bleeds into neighbor cells, where later partial repaints (cursor row) shave it into ragged artifacts since rows repaint by background fill without clearRect. maxWidth compresses the advance to fit, the way a Mono-patched font would. Verified pixel-level against WezTerm rendering the same starship prompt (fading-arrow theme, rounded caps, Nerd icons) on a 2x display. Co-Authored-By: Claude Fable 5 <noreply@anthropic.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.
Fixes #184.
What
Two changes in
CanvasRenderer.renderCellText:Powerline separators (
U+E0B0-U+E0B7) are drawn as exact vector geometry (solid triangles, angle outlines, half-circles) covering the cell box, instead of font glyphs. Font rasterization leaves AA fringe on the diagonals and sub-cell ink height (background bleeds through above/below), which reads as smudged, banded segment edges in Powerline prompts. WezTerm and xterm.js (customGlyphs) special-case these codepoints the same way. Shapes use the already-setfillStyle, so colors follow the cell foreground exactly like a glyph would; even codepoints are solid variants, odd ones the thin outline variants (1px stroke).fillTextnow passes the cell's allocated width asmaxWidth. Fallback-font glyphs (Nerd icons, emoji) often advance wider than the primary-font cell (Symbols Nerd Font Mono icons: 1em = 1.67 cells at 13px); unclamped ink bleeds into neighbor cells where partial repaints (cursor row) shave it into ragged artifacts, since rows repaint by background fill withoutclearRect.maxWidthcompresses the advance to fit — same result as a Mono-patched font, with no per-glyphmeasureTextcost.Testing
bun run fmt && bun run lint && bun run typecheckclean.bun test: no regressions vs a clean checkout in my environment (the same 302 pre-existing failures that need WASM build artifacts); adds 2 passing tests for the new exportedisPowerlineSeparatorrange helper.🤖 Generated with Claude Code