feat(renderer): powerline + block char pixel-perfect rendering#22
Merged
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
- Add renderBlockChar() for U+2580-U+259F (block elements) as filled rectangles, eliminating inter-character gaps in ASCII art/progress bars - Add renderPowerlineGlyph() for U+E0B0-U+E0B7 as canvas vector paths, ensuring glyphs span exactly the cell height regardless of font - Switch measureFont() to fontBoundingBox metrics so cell height accommodates the full font cap-height (required by powerline chars) - Merge DPR-aware rounding from PR coder#146 with fontBoundingBox: cells stay pixel-perfect at non-integer device pixel ratios - Pass cursor.style from IRenderable.getCursor() through to renderCursor() so callers can override the cursor shape - buildFontString() helper quotes font family names that contain spaces - Add demo/bin/render-test.ts and demo/render-test.html for visual regression testing (puppeteer auto-installed on demand) - Fix pre-existing biome lint issues in viewport/iris test files Co-authored-by: Stuart Lang <stuart.b.lang@gmail.com> Inspired-by: coder#128
3adc3df to
3805e90
Compare
|
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.



Summary
fillRect()calls instead of font glyphs, eliminating inter-character gaps in box-drawing art and progress barsmeasureFont()now usesfontBoundingBoxAscent/Descentinstead of per-glyphactualBoundingBox, ensuring cell height covers all glyphs in the font — combined with the existing DPR-rounding from PR fix(renderer): align font metrics to device pixel boundaries to prevent seams coder/ghostty-web#146IRenderable.getCursor()extended to return optionalstylefield, allowing callers to override cursor shape per bufferdemo/bin/render-test.ts(puppeteer-based visual regression runner) anddemo/render-test.htmlAttribution
Thanks to @stuartlang for the original implementation.
Test plan
bun run fmt && bun run lint && bun run typecheckbun test(397/397 pass)bun run build:lib