From 44877d490e85bcea16505534811e18b44f8ff218 Mon Sep 17 00:00:00 2001 From: MStarha <59487310+MStarha@users.noreply.github.com> Date: Tue, 29 Oct 2024 12:51:17 +0100 Subject: [PATCH] Respect `Style::override_font_id` in `RichText` (#5310) Currently `Style::override_font_id` does not affect widgets with their `TextStyle` like `Button`s, `ComboBox`es, `CheckBox`es, etc. This PR fixes this behavior such that all widgets using default configuration of `RichText` are affected by this setting. * [x] I have followed the instructions in the PR template --- crates/egui/src/widget_text.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/egui/src/widget_text.rs b/crates/egui/src/widget_text.rs index 80ee6f05..011a4adc 100644 --- a/crates/egui/src/widget_text.rs +++ b/crates/egui/src/widget_text.rs @@ -380,6 +380,9 @@ impl RichText { || fallback_font.resolve(style), |text_style| text_style.resolve(style), ); + if let Some(fid) = style.override_font_id.clone() { + font_id = fid; + } if let Some(size) = size { font_id.size = size; }