Skip to content

fix: terminal font rendering improvements#175

Open
wosuxiongmao wants to merge 4 commits intoDeadWaveWave:mainfrom
wosuxiongmao:main
Open

fix: terminal font rendering improvements#175
wosuxiongmao wants to merge 4 commits intoDeadWaveWave:mainfrom
wosuxiongmao:main

Conversation

@wosuxiongmao
Copy link
Copy Markdown
Contributor

@wosuxiongmao wosuxiongmao commented Apr 14, 2026

Summary

  • Improve terminal font rendering clarity at fractional DPI (125% scaling) by adding CSS font-smoothing rules
  • Fix WebGL pixel snapping timing to wait for DOM layout settlement via double-rAF
  • Pass fontSize to xterm Terminal at construction time for proper initialization

Test plan

  • Verify terminal text is crisp at 125% DPI on Windows
  • Verify WebGL renderer doesn't produce visual glitches during resize
  • Verify terminal initializes with correct font size

wosuxiongmao and others added 4 commits April 14, 2026 17:11
At 125% DPI (devicePixelRatio=1.25), xterm DOM renderer positions
character spans at fractional pixel values, causing browser subpixel
antialiasing to blur text. Add CSS font-smoothing rules to force
grayscale antialiasing and geometric precision rendering for crisper
terminal text.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…settled

The single requestAnimationFrame in scheduleWebglPixelSnapping could fire
before the terminal canvas DOM layout was fully computed on initial render,
causing incorrect pixel snapping offsets. Using double-rAF ensures the
layout has settled before applying the transform.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Previously fontSize was omitted from new Terminal() options, causing xterm
to use its default of 15px before useTerminalAppearanceSync could apply
the user-configured terminalFontSize. This resulted in Codex terminals
rendering at 15px instead of the configured size (e.g. 13px) on Windows
with fractional DPI.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…or profile

- Round width, height, and translate offsets to integer pixels in
  nodeFrameStyle to eliminate sub-pixel blur from fractional transforms.
- Split font-smoothing CSS so non-Windows keeps forced antialiased while
  Windows uses its native ClearType subpixel rendering.
- Set data-cove-platform on <html> from renderer to drive the CSS selectors.
- Add force-color-profile=srgb Chromium switch to reduce color-space edge artifacts.
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