From a1651cb84522451dc77037061595f3132f0a0e28 Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Mon, 20 Jul 2026 02:27:32 +0000 Subject: [PATCH 54/71] fix(macos): enable font anti-aliasing (render mode was defaulting to mono) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Glyphs rendered aliased (jagged) because FontDescriptions::renderMode has no default initializer, so it value-initialized to enum value 0 = render_mode:: bitmap — 1-bit monochrome rasterization, no anti-aliasing. The frontend never set it. The Qt frontend defaults render mode to `gray`; do the same. Set fonts.renderMode = text::render_mode::gray (grayscale AA) in bridge_create. gray is the right choice here: lcd/light are subpixel modes for LCD panels and FreeType's LCD filter is frequently not built into this toolchain. This joins the set of engine fields a fresh frontend must seed (setCellPixelSize, setImageDecoder, setWordDelimiters, ...). May also help the bold-label spacing seen with fastfetch, since mono rasterization positions/sizes glyphs on integer boundaries differently than anti-aliased rendering — to be confirmed after rebuild. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01AeG2jwYMX5gdvvtUnx3PJa --- src/contour_macos/SessionBridge.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/contour_macos/SessionBridge.cpp b/src/contour_macos/SessionBridge.cpp index 6ed50a94..1b4e23c5 100644 --- a/src/contour_macos/SessionBridge.cpp +++ b/src/contour_macos/SessionBridge.cpp @@ -78,6 +78,11 @@ TerminalSession* bridge_create(int widthPx, auto fonts = vtrasterizer::FontDescriptions {}; fonts.dpi = text::DPI { font.dpiX, font.dpiY }; fonts.size = text::font_size { font.sizePt }; + // render_mode has no default initializer, so it value-initializes to enum value 0 = `bitmap` + // (1-bit monochrome, no anti-aliasing) — glyphs come out aliased. The Qt frontend defaults to + // `gray`; do the same. gray (grayscale AA) is the right pick here: lcd/light are subpixel modes + // for LCD panels, and FreeType's LCD filter is often not built in on this toolchain anyway. + fonts.renderMode = text::render_mode::gray; std::string const family = font.family ? font.family : "Menlo"; for (text::font_description* fd: { &fonts.regular, &fonts.bold, &fonts.italic, &fonts.boldItalic }) {