fix(ui): render workspace terminal with Canvas + CJK fonts#253
fix(ui): render workspace terminal with Canvas + CJK fonts#253maxx-masa wants to merge 1 commit into
Conversation
Switch the xterm renderer from WebGL to Canvas (@xterm/addon-canvas) and add "Noto Sans Mono CJK JP" / "Noto Sans CJK JP" to the terminal font stack so Japanese text renders correctly in workspace sessions. The WebGL glyph atlas drew any styled CJK cell it could not rasterize (notably italic Japanese — Noto Sans Mono CJK JP has no italic face) as a solid black box. The Canvas renderer rasterizes each cell via 2D fillText, falling back through the browser font stack and synthesizing obliques, so bold/italic Japanese renders correctly — while staying much faster than the DOM renderer. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
@maxx-masa is attempting to deploy a commit to the luokerenx4's Team Team on Vercel. A member of the Team first needs to authorize it. |
|
Thanks for the report. We tried hard to reproduce this and couldn't, on two platforms with the exact production config (same
One correction to the diagnosis: the WebGL renderer's glyph rasterization is the same Canvas2D So instead of a blanket renderer swap, master now ships an escape hatch (#305): localStorage.setItem('openalice.terminal.renderer', 'dom') // then reloadCould you try current master on the machine that showed black boxes and report:
If (1) yes + (2) yes, that confirms the GPU-pipeline diagnosis and we can talk about auto-detection or surfacing the toggle in settings. Leaving this PR open while we wait for your results. |
The WebGL renderer's glyph rasterization is plain Canvas2D (shared with the DOM renderer), but the rasterized glyphs then ride a GPU pipeline with a known family of environment-specific corruption bugs (black boxes over CJK, garbled cells — same xterm atlas as VS Code's terminal, see microsoft/vscode#137047/#163936/#288682). None of them throw, so they can't be auto-detected; VS Code's answer is the gpuAcceleration setting. Ours: - `localStorage['openalice.terminal.renderer'] = 'dom'` forces the DOM renderer (unset/anything else keeps WebGL). - Shared `attachWebglRenderer` loader: addon-throw and context-loss both degrade to the DOM renderer; the demo replay previously had no context-loss handling at all. Investigated from external PR TraderAlice#253's black-box report — not reproducible on macOS nor Linux+Noto CJK with identical config, so the fix is an escape hatch rather than a blanket renderer swap. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Summary
@xterm/addon-canvas) and addNoto Sans Mono CJK JP/Noto Sans CJK JPto the font stack.fillText, falling back through the browser font stack and synthesizing obliques, so bold/italic Japanese renders correctly — while staying much faster than the DOM renderer.Test plan
cd ui && npx tsc -b— not run locally: node_modules is out of sync with this branch's base (fork base = current upstream), and a full install would disrupt the local dev environment. The change is a minimal, standard renderer swap.Boundary touch
None.
🤖 Generated with Claude Code