From 5786712faf08c2134d3833ed8fc295c8663358d1 Mon Sep 17 00:00:00 2001 From: xiaji Date: Fri, 10 Apr 2026 22:57:04 +0800 Subject: [PATCH] fix: add Chinese font support --- src/gui.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gui.rs b/src/gui.rs index 676c354..1e19454 100644 --- a/src/gui.rs +++ b/src/gui.rs @@ -76,10 +76,11 @@ pub fn gui_run() { fn set_font(ctx: &egui::Context) { let mut style = (*ctx.style()).clone(); + let font_family = FontFamily::Name("Microsoft YaHei".into()); style.text_styles = [ - (TextStyle::Heading, FontId::new(18.0, FontFamily::Proportional)), - (TextStyle::Body, FontId::new(14.0, FontFamily::Proportional)), - (TextStyle::Button, FontId::new(14.0, FontFamily::Proportional)), + (TextStyle::Heading, FontId::new(18.0, font_family.clone())), + (TextStyle::Body, FontId::new(14.0, font_family.clone())), + (TextStyle::Button, FontId::new(14.0, font_family.clone())), ].into(); ctx.set_style(style); }