Preferences: choose the interface font (#1408)
Adds an Interface font setting that leads the proportional family, with the default face and CJK/Hangul fallbacks kept behind it (#1290). Co-authored-by: DuBearte <DuBearte@users.noreply.github.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
5 files changed
+148
-9
No files matched your search
@@ -374,6 +374,8 @@ pub struct SolveApp {
|
||||
/// The language the installed font fallback chain is ordered for (`fonts::fallback_order`);
|
||||
/// changing `preferences.language` re-installs the fonts on the next frame.
|
||||
applied_fonts_language: String,
|
||||
/// The interface font the fonts were last set up with (`Prefs::ui_font`).
|
||||
applied_ui_font: String,
|
||||
}
|
||||
|
||||
impl SolveApp {
|
||||
@@ -456,6 +458,7 @@ impl SolveApp {
|
||||
file_load: file_load::FileLoad::default(),
|
||||
docs: documents::Documents::default(),
|
||||
applied_fonts_language: "en".into(),
|
||||
applied_ui_font: String::new(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1273,9 +1276,10 @@ impl SolveApp {
|
||||
pub fn ui(&mut self, ui: &mut egui::Ui) {
|
||||
expression_complete::begin_frame(ui.ctx());
|
||||
let t0 = now_ms();
|
||||
if self.preferences.language != self.applied_fonts_language {
|
||||
if self.preferences.language != self.applied_fonts_language || self.preferences.ui_font != self.applied_ui_font {
|
||||
self.applied_fonts_language.clone_from(&self.preferences.language);
|
||||
crate::fonts::setup_fonts_for(ui.ctx(), &self.preferences.language);
|
||||
self.applied_ui_font.clone_from(&self.preferences.ui_font);
|
||||
crate::fonts::setup_fonts_for(ui.ctx(), &self.preferences.language, &self.preferences.ui_font);
|
||||
}
|
||||
let _language = crate::i18n::scope(&self.preferences.language);
|
||||
let mut report_input = None;
|
||||
|
||||
Reference in new issue
Block a user