From f515c8d7a660e1835d2fd46a2318208e38fd7286 Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Sun, 19 Jul 2026 08:48:55 +0000 Subject: [PATCH 08/71] fix(macos): force monospace font spacing in the render probe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The probe left font_description.spacing at its default (proportional), so the shaper applied proportional kerning within runs — "mac" rendered too sparse and "OS"/"we" too tight. A terminal is a fixed grid, so set spacing = mono on all faces to get uniform advances. This is a font-configuration fix, not a compositor change; the compositor already blits each glyph at the engine-provided position. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01AeG2jwYMX5gdvvtUnx3PJa --- src/contour_macos/render_probe.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/contour_macos/render_probe.cpp b/src/contour_macos/render_probe.cpp index 2f78a45a..e3ed0eea 100644 --- a/src/contour_macos/render_probe.cpp +++ b/src/contour_macos/render_probe.cpp @@ -80,7 +80,12 @@ int main(int argc, char** argv) auto fonts = FontDescriptions {}; char const* const family = argc > 2 ? argv[2] : "Menlo"; for (text::font_description* fd: { &fonts.regular, &fonts.bold, &fonts.italic, &fonts.boldItalic }) + { fd->familyName = family; + // A terminal is a fixed grid: force monospace advances so the shaper does not apply + // proportional kerning (which otherwise makes "mac" too sparse and "OS"/"we" too tight). + fd->spacing = text::font_spacing::mono; + } fonts.regular.weight = text::font_weight::normal; fonts.bold.weight = text::font_weight::bold; fonts.italic.slant = text::font_slant::italic;