#36

fix(renderer): draw braille patterns with square dots like Ghostty

Openalexanderkreidichwants to merge intofrom

Summary

Braille patterns (U+2800–U+28FF), used by common terminal spinners (⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏), rendered as vertical dashes on an uneven grid instead of round-ish dots.

Cause: drawBraille sized each dot as 18% of the cell width and 18% of the cell height. Terminal cells are roughly 2× taller than wide, so dots became ~1:2 rectangles, and fractional positions snapped with floor/ceil produced inconsistent dot sizes and spacing.

Fix: port Ghostty's draw2800_28FF sprite layout (src/font/sprite/draw/braille.zig):

  • square dots of size min(width/4, height/8);
  • integer margins/spacing, with leftover pixels distributed in the same priority order as Ghostty;
  • cell origin rounded once so all dots share one pixel grid.

Both the WebGPU and WebGL paths call the same drawBraille, so no renderer-specific changes are needed.

Validation

  • New tests/braille.test.ts: square dots within cell bounds for several cell sizes, exact Ghostty layout for a 10×22 cell, bit→dot mapping, origin snapping, and empty U+2800.
  • bun run test:ci — 343 pass, 0 fail
  • bunx oxlint / bunx oxfmt --check on changed files — clean
  • bunx tsc --noEmit -p tsconfig.build.json — clean
  • No screenshots attached; I did not check the change in the playground.