Windows system ClearType font anti-aliasing integration for cpui
Raw Developer Origin & Technical Request
GitHub Issue
Dec 5, 2026
## 现象
Windows 11、175% 缩放、微软雅黑、ClearType 开启。同一个 cpui 窗口,只把 `ui.set_text_antialias(TextAntialias::Subpixel(SubpixelOrder::Rgb))` 打开和关掉,4 倍放大后是这样:
把 Edge、VS Code、Typora 里同样的白底黑字放大,笔画端点和交界处都有红/蓝色边,也就是 ClearType。它们在 Windows 上都是 Chromium/Skia,不透明图层上按系统设置做子像素;Tauri 走 WebView2,同理。而 cpui 的应用默认永远是灰度。
## 现在是灰度,因为 Windows 分支没接系统设置
`crates/cpui/src/platform.rs`:
```rust
pub(crate) fn desktop_text(window: &Window) -> DesktopTextSettings {
#[cfg(all(unix, not(any(target_vendor = "apple", target_os = "android"))))]
{
// portal / XSETTINGS
}
#[cfg(not(all(unix, not(any(target_vendor = "apple", target_os = "android")))))]
{
let _ = window;
DesktopTextSettings::default()
}
}
```
`TextAntialias::System` 的语义是跟随系统,但 Windows 上 `DesktopTextSettings` 恒为空,`system.subpixel` 是 `None`,`antialias.raster()` 于是只能返回 `Raster::Grayscale`。Linux 那条分支是完整的:抗锯齿方式、条纹顺序、LCD filter、hinting 都从桌面读。
看起来不像是有意让 Windows 用灰度,更像是这块只做了 Linux。
## 建议:读 Windows 的系统文字设置
`SystemParametersInfoW` 就够了:
| 设置 | 值 | 映射 |
|---|---|---|
| `SPI_GETFONTSMOOTHING` | `0x004A` | 关 → `DesktopAntialias::None` |
| `SPI_GETFONTSMOOTHINGTYPE` | `0x200A`,`FE_FONTSMOOTHINGSTANDARD` 1 / `FE_FONTSMOOTHINGCLEARTYPE` 2 | 灰度 / `Subpixel(..)` |
| `SPI_GETFONTSMOOTHINGORIENTATION` | `0x2012`,`FE_FONTSMOOTHINGORIENTATIONRGB` 1 / `BGR` 0 | `SubpixelOrder::Rgb` / `Bgr...
Developer Debate & Comments
No active discussions extracted for this entry yet.
Adjacent Repository Pain Points
Other highly discussed features and pain points extracted from DEEIX-AI/cpui.
Frequently Asked Questions
Market intelligence mapped to Windows system ClearType font anti-aliasing integration for cpui.
How is Windows system ClearType font anti-aliasing integration for cpui positioned in the market?
What is the general sentiment around Windows system ClearType font anti-aliasing integration for cpui?
What architecture is tied to Windows system ClearType font anti-aliasing integration for cpui?
Engagement Signals
Cross-Market Term Frequency
Counts stored text matches for foundational terms like TextAntialias::System and SystemParametersInfoW in analysed public discussions. These counts do not measure adoption.
Stored text matches, not adoption or market-share measurements.
- TextAntialias::System: 1 records
- SystemParametersInfoW: 1 records
- SPI_GETFONTSMOOTHING: 1 records
- subpixel rendering: 1 records
SaaS Metrics