19 lines
661 B
Rust
19 lines
661 B
Rust
pub fn setup_fonts(ctx: &eframe::egui::Context) {
|
|
let mut fonts = eframe::egui::FontDefinitions::default();
|
|
|
|
let font_data = include_bytes!("../fonts/NotoSansSC-Regular.ttf");
|
|
fonts.font_data.insert(
|
|
"NotoSansSC".to_string(),
|
|
eframe::egui::FontData::from_static(font_data).into(),
|
|
);
|
|
|
|
if let Some(proportional) = fonts.families.get_mut(&eframe::egui::FontFamily::Proportional) {
|
|
proportional.insert(0, "NotoSansSC".to_string());
|
|
}
|
|
if let Some(monospace) = fonts.families.get_mut(&eframe::egui::FontFamily::Monospace) {
|
|
monospace.insert(0, "NotoSansSC".to_string());
|
|
}
|
|
|
|
ctx.set_fonts(fonts);
|
|
}
|