microsoft / microsoft/terminal
Windows Terminal text renders less sharply than Alacritty with identical font, size, AA and colors
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 105k
- Forks
- 9.6k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 29
Description
### Windows Terminal version
1.25.260710002-preview
### Windows build number
10.0.20348.3091
### Other Software
Alacritty Version 0.17.0
- Alacritty (reference terminal; portable build, Version 0.17.0)
- Font: Sarasa Term SC (TTF, unhinted build), 12pt regular - the same font file is used by both terminals
- Display: EIZO CS2740, 27" 4K, Windows scaling 200% (physical 3840x2160); GPU: NVIDIA RTX A400
### Steps to reproduce
1. Configure both terminals with: Sarasa Term SC, 12pt, regular; foreground #d8d8d8, background #181818; WT `antialiasingMode = "cleartype"` (Alacritty on Windows always renders ClearType, using `CLEARTYPE_3x1` masks).
2. Display one line in both terminals: `龘爨靐齉韘齑燚犇猋麤` (U+9F98 U+7228 U+9750 U+9F49 U+97D8 U+9F51 U+71DA U+7287 U+730B U+9EA4).
3. Compare at 1x and at 800-1000% zoom (nearest neighbor, e.g. HyperSnap).
### Expected Behavior
With identical font, size, weight, antialiasing and colors, the glyph pixels should be nearly identical in both terminals. In particular, 1-2px gaps between closely spaced strokes should stay at the background color, as they do in Alacritty.
Windows Terminal
Alacritty
### Actual Behavior
WT renders strokes measurably thicker and lifts the gray level inside gaps between dense strokes, effectively closing them. The worst case is 靐 (U+9750, three 雷 stacked): the top 雷 almost merges into a solid blob in WT, while Alacritty keeps every gap visible. Whole-line averaged metrics look nearly identical; per-glyph measurements show a clear difference (physical pixels, per-glyph 32x51 px region; ink = sum of normalized coverage, HF_v = sum of |coverage(y+1)-coverage(y)|, higher = crisper horizontal stroke edges):
| 靐 U+9750 | Alacritty | WT D3D backend, 12pt | WT D3D backend, 12.5pt |
|---|---|---|---|
| ink coverage | 464.6 | 516.8 (+11%) | 561.8 (+21%) |
| HF_v | 386.8 | 341.9 (-12%) | 295.6 (-24%) |
| 犇 U+7287 | Alacritty | WT D3D, 12pt | WT D3D, 12.5pt |
|---|---|---|---|
| ink coverage | 372.3 | 412.3 (+11%) | 434.2 (+17%) |
| HF_v | 196.3 | 196.0 (equal) | 204.5 |
For 犇, high-frequency energy is equal while ink is +11%: strokes are uniformly thickened with sharp edges, not edge-blurred. The thickening is what closes the gaps in dense glyphs like 靐. Other findings:
- 12.5pt is worse than 12pt: at 200% DPI, 12.5pt is a fractional 33.33px em, which adds vertical resampling on top of the thickening.
- `"rendering.graphicsAPI": "direct2d"` does not fix it: the top half of 靐 becomes sharper while the bottom half becomes softer. Net legibility is unchanged.
- Suspected cause: BackendD3D blends ClearType with a gamma-corrected lerp (see the `alphaCorrected` comment in `src/renderer/atlas/BackendD3D.cpp`), which lifts mid-tone coverage and fattens strokes. BackendD2D delegates to `ID2D1RenderTarget::DrawGlyphRun` and deviates differently. Alacritty rasterizes each glyph to a `CLEARTYPE_3x1` mask at integer pixel positions and blends it with its own shader, keeping gaps at 0 coverage.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/renderer/atlas/BackendD3D.cpp and the alphaCorrected comment, then compare the D3D and D2D glyph-rendering paths described in the report. Reproduce the Sarasa Term SC case at 200% DPI using the supplied glyph line and compare it with Alacritty; done means dense glyph gaps remain visible without thicker strokes in Windows Terminal.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-graphics, desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100