-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I tried with a different font and the character is displayed correctly: use eframe::egui::{self, FontFamily};
fn main() -> eframe::Result {
let options = eframe::NativeOptions {
viewport: egui::ViewportBuilder::default().with_inner_size([320.0, 240.0]),
..Default::default()
};
eframe::run_simple_native("My egui App", options, move |ctx, _frame| {
let mut fonts = egui::FontDefinitions::empty();
fonts.font_data.insert(
"my_font".to_string(),
std::sync::Arc::new(egui::FontData::from_static(include_bytes!(
"../FiraCodeNerdFont-Retina.ttf"
))),
);
for family in [FontFamily::Proportional, FontFamily::Monospace] {
fonts
.families
.entry(family)
.or_default()
.insert(0, "my_font".to_string());
}
ctx.set_fonts(fonts);
egui::CentralPanel::default().show(ctx, |ui| {
ui.heading("⌫");
ui.label("⌫");
ui.monospace("⌫");
});
})
} (using `"u{232b}" works the same) But with the SourceCodePro font, it displays a question mark as well, although it is rendered in kitty: It could be that some fonts have an unusual mapping that kitty knows how to deal with and egui doesn't, or it could be that the font doesn't actually have this character, and kitty is getting it from a fallback font. I'm leaning towards the latter, because if I set the kitty font to an invalid name, it uses some default font and this character is still displayed, and looks the same as it does with SourceCodePro: |
Beta Was this translation helpful? Give feedback.
I tried with a different font and the character is displayed correctly: