From 466a2e22d5722ba2222753bf9587c8b682fd4b68 Mon Sep 17 00:00:00 2001 From: localcc Date: Tue, 9 Sep 2025 12:46:59 +0200 Subject: [PATCH] Improve font rendering on macOS (#37622) Part of https://github.com/zed-industries/zed/issues/7992 Release Notes: - N/A --- crates/gpui/src/platform/mac/text_system.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/gpui/src/platform/mac/text_system.rs b/crates/gpui/src/platform/mac/text_system.rs index 72a0f2e565d9937e3aaf4082b663c3e2ae6ac91d..9144b2a23a40bd527e1441cf71adcc2562c33f3c 100644 --- a/crates/gpui/src/platform/mac/text_system.rs +++ b/crates/gpui/src/platform/mac/text_system.rs @@ -16,7 +16,7 @@ use core_foundation::{ use core_graphics::{ base::{CGGlyph, kCGImageAlphaPremultipliedLast}, color_space::CGColorSpace, - context::CGContext, + context::{CGContext, CGTextDrawingMode}, display::CGPoint, }; use core_text::{ @@ -396,6 +396,12 @@ impl MacTextSystemState { let subpixel_shift = params .subpixel_variant .map(|v| v as f32 / SUBPIXEL_VARIANTS as f32); + cx.set_allows_font_smoothing(true); + cx.set_should_smooth_fonts(true); + cx.set_text_drawing_mode(CGTextDrawingMode::CGTextFill); + cx.set_gray_fill_color(0.0, 1.0); + cx.set_allows_antialiasing(true); + cx.set_should_antialias(true); cx.set_allows_font_subpixel_positioning(true); cx.set_should_subpixel_position_fonts(true); cx.set_allows_font_subpixel_quantization(false);