From 360613aa6eedfa4e441d658d98db502e8a81442b Mon Sep 17 00:00:00 2001 From: Kuddev Date: Mon, 28 Sep 2026 22:51:10 +0800 Subject: [PATCH] perf(fonts): embed only the default Maple font Remove the additional Maple Mono NF CN embedding while preserving the default Maple Mono Normal NF CN font, rasterization, and system/imported font loading. --- nebula_app/src/gpui_shell/mod.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/nebula_app/src/gpui_shell/mod.rs b/nebula_app/src/gpui_shell/mod.rs index a30d62f..8dd0f02 100644 --- a/nebula_app/src/gpui_shell/mod.rs +++ b/nebula_app/src/gpui_shell/mod.rs @@ -225,13 +225,11 @@ fn init(cx: &mut App) { } fn register_bundled_fonts(cx: &App) { - // GPUI resolves a family through the system collection first and silently - // falls back when it is absent. Add Maple before any component/window can - // resolve a font so the default remains the same private face as winit. - if let Err(error) = cx.text_system().add_fonts(vec![ - Cow::Borrowed(crate::font_install::REQUIRED_FONT_BYTES), - Cow::Borrowed(include_bytes!("../../../assets/fonts/MapleMono-NF-CN-Regular.ttf")), - ]) { + // 在组件解析字体前注册默认 Normal 字体,保持原有字形与中文/图标兜底。 + // 其他 Maple 变体走系统或导入字体,避免再内嵌一套完整的中文与图标字库。 + if let Err(error) = + cx.text_system().add_fonts(vec![Cow::Borrowed(crate::font_install::REQUIRED_FONT_BYTES)]) + { try_write_stderr(format_args!( "[nebula:gpui] failed to register bundled Maple font: {error}" ));