You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The first image below appears to me at least to have a title font that is far to large (I am using Ubuntu 24.04).
The second image shows a reduced font size but still doesn't look great to me. The code for reducing the font size for the second case is below.
A simple method call for setting the font properties would be very helpful.
let mut style: egui::Style = (*ctx.style()).clone();
style.text_styles.insert(
egui::TextStyle::Heading,
FontId::new(14.0, egui::FontFamily::Proportional), // Set the font size to 14.0
);
// Apply the new style
ctx.set_style(style);
egui::Window::new("THE TITLE").show(ctx, |ui| {
ui.label("This window has a custom title font size.");
ui.label(egui::RichText::new("I'm a heading").heading());
});
The text was updated successfully, but these errors were encountered:
Hi!
Since the Window::new() function needs an Into<WidgetText> (WidgetText) as an argument, you can actually pass in a RichText so you can directly modify the header's style.
Example:
The first image below appears to me at least to have a title font that is far to large (I am using Ubuntu 24.04).
The second image shows a reduced font size but still doesn't look great to me. The code for reducing the font size for the second case is below.
A simple method call for setting the font properties would be very helpful.
The text was updated successfully, but these errors were encountered: