From 0d082a394592c4d7f3c8f7ace6a33c94c754aa71 Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Fri, 9 Jan 2026 11:22:06 -0500 Subject: [PATCH] Fix visual test font regression (#46461) The visual test infrastructure changes in #46324 accidentally switched from `settings::init(cx)` to `SettingsStore::test(cx)`, which uses Courier font instead of the real Zed fonts (IBM Plex Sans / Lilex). This restores the correct font loading: 1. Load embedded fonts with `Assets.load_fonts(cx)` 2. Use `settings::init(cx)` to get the real default settings with proper fonts Release Notes: - N/A --- crates/zed/src/visual_test_runner.rs | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/crates/zed/src/visual_test_runner.rs b/crates/zed/src/visual_test_runner.rs index 8a660b20c40d6e02e636956cea4318fdc2973884..888f944922f18ed941bc3ff21de92fb512ed7ac6 100644 --- a/crates/zed/src/visual_test_runner.rs +++ b/crates/zed/src/visual_test_runner.rs @@ -58,7 +58,7 @@ use { }, image::RgbaImage, project_panel::ProjectPanel, - settings::{NotifyWhenAgentWaiting, Settings as _, SettingsStore}, + settings::{NotifyWhenAgentWaiting, Settings as _}, std::{ any::Any, path::{Path, PathBuf}, @@ -146,17 +146,15 @@ fn run_visual_tests(project_path: PathBuf, update_baseline: bool) -> Result<()> // Use real Assets so that SVG icons render properly let mut cx = VisualTestAppContext::with_asset_source(Arc::new(Assets)); - // Initialize settings store first (required by theme and other subsystems) - // and disable telemetry to prevent HTTP errors from FakeHttpClient + // Load embedded fonts (IBM Plex Sans, Lilex, etc.) so UI renders with correct fonts cx.update(|cx| { - let mut settings_store = SettingsStore::test(cx); - settings_store.update_user_settings(cx, |settings| { - settings.telemetry = Some(settings::TelemetrySettingsContent { - diagnostics: Some(false), - metrics: Some(false), - }); - }); - cx.set_global(settings_store); + Assets.load_fonts(cx).unwrap(); + }); + + // Initialize settings store with real default settings (not test settings) + // Test settings use Courier font, but we want the real Zed fonts for visual tests + cx.update(|cx| { + settings::init(cx); }); // Create AppState using the test initialization