Skip to content

feat(renderer): powerline + block char pixel-perfect rendering#22

Merged
diegosouzapw merged 1 commit into
mainfrom
feat/port-pr-128-powerline-rendering
May 24, 2026
Merged

feat(renderer): powerline + block char pixel-perfect rendering#22
diegosouzapw merged 1 commit into
mainfrom
feat/port-pr-128-powerline-rendering

Conversation

@diegosouzapw
Copy link
Copy Markdown
Owner

Summary

  • Block elements (U+2580–U+259F): rendered as fillRect() calls instead of font glyphs, eliminating inter-character gaps in box-drawing art and progress bars
  • Powerline glyphs (U+E0B0–U+E0B7): rendered as canvas vector paths (triangles, semicircles) so they span the exact cell height regardless of font metrics
  • Font metrics: measureFont() now uses fontBoundingBoxAscent/Descent instead of per-glyph actualBoundingBox, 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#146
  • Cursor style: IRenderable.getCursor() extended to return optional style field, allowing callers to override cursor shape per buffer
  • Demo: added demo/bin/render-test.ts (puppeteer-based visual regression runner) and demo/render-test.html

Attribution

Thanks to @stuartlang for the original implementation.

Test plan

  • bun run fmt && bun run lint && bun run typecheck
  • bun test (397/397 pass)
  • bun run build:lib

@gemini-code-assist
Copy link
Copy Markdown

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
@diegosouzapw diegosouzapw force-pushed the feat/port-pr-128-powerline-rendering branch from 3adc3df to 3805e90 Compare May 24, 2026 01:30
@diegosouzapw diegosouzapw merged commit 7ce804c into main May 24, 2026
1 check passed
@diegosouzapw diegosouzapw deleted the feat/port-pr-128-powerline-rendering branch May 24, 2026 01:30
@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant