Custom font not applying
Hi there,
I am trying out eframe/egui for the first time (thanks for all the docs and examples!).
I'm following the custom font example to add a custom font to my own eframe app, but my custom font is not applying. I'm guessing that I'm making a simple mistake. PR here, and here's the code I added to the new fn in my app struct impl in app.rs:
let mut fonts = egui::FontDefinitions::default();
fonts.font_data.insert(
"EBGaramond".to_owned(),
egui::FontData::from_static(include_bytes!("../assets/EBGaramond-Regular.ttf"))
);
fonts.families.entry(egui::FontFamily::Proportional).or_default().insert(0,"EBGaramond".to_owned());
fonts.families.entry(egui::FontFamily::Monospace).or_default().insert(0,"EBGaramond".to_owned());
cc.egui_ctx.set_fonts(fonts);
I also tried removing the default_fonts feature in Cargo.toml to break fonts altogether, but my app still built and ran.
Thank you.
You can check out the section from one of my apps here, hope it helps: https://github.com/markusdd/rusty_meter/blob/054149fa6114bda3b2e91a5261d3e70baf3692c1/src/app.rs#L320
Thanks, @markusdd! Still no luck with the approach you took unfortunately, but I'll report back here if I can find the issue.