From 7bda288fe61bdbf4569e677a6963a4cfa86ed4b5 Mon Sep 17 00:00:00 2001 From: Lucas Meurer Date: Mon, 7 Sep 2026 10:54:37 +0200 Subject: [PATCH] Log when `system_font` feature is off (#8520) --- crates/eframe/src/native/epi_integration.rs | 35 +++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/crates/eframe/src/native/epi_integration.rs b/crates/eframe/src/native/epi_integration.rs index a170d384..325674de 100644 --- a/crates/eframe/src/native/epi_integration.rs +++ b/crates/eframe/src/native/epi_integration.rs @@ -147,6 +147,35 @@ pub fn create_storage_with_file(_file: impl Into) -> Option) -> Option { + use core::sync::atomic::Ordering::Relaxed; + if !self.warned.swap(true, Relaxed) { + log::info!( + "No font has {:?}. \ + Enable the `system_fonts` feature in `eframe`, \ + add a font with `egui::Context::add_font`, \ + or set `NativeOptions::system_font_fallback` to `false` to silence this.", + request.cluster + ); + } + None + } +} + +// ---------------------------------------------------------------------------- + /// Everything needed to make a winit-based integration for [`epi`]. /// /// Only one instance per app (not one per viewport). @@ -217,9 +246,11 @@ impl EpiIntegration { Some(icon), ); - #[cfg(feature = "system_fonts")] if native_options.system_font_fallback { - egui_ctx.add_font_provider(Arc::new(egui_system_fonts::SystemFontProvider::new())); + egui_ctx.add_font_provider(cfg_select! { + feature = "system_fonts" => Arc::new(egui_system_fonts::SystemFontProvider::new()), + _ => Arc::new(MissingSystemFontsWarning::default()), + }); } Self {