1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-29 04:40:03 -04:00

Add kittest snapshot test of italics (#7603)

This commit is contained in:
Emil Ernerfeldt
2025-10-07 17:22:31 +02:00
committed by GitHub
parent 9cb4e6a54e
commit 683214bfe8
7 changed files with 43 additions and 0 deletions

View File

@@ -24,3 +24,28 @@ fn test_kerning() {
}
}
}
#[test]
fn test_italics() {
for pixels_per_point in [1.0, 2.0_f32.sqrt(), 2.0] {
for theme in [egui::Theme::Dark, egui::Theme::Light] {
let mut harness = Harness::builder()
.with_pixels_per_point(pixels_per_point)
.with_theme(theme)
.build_ui(|ui| {
ui.label(egui::RichText::new("Small italics").italics().small());
ui.label(egui::RichText::new("Normal italics").italics());
ui.label(egui::RichText::new("Large italics").italics().size(22.0));
});
harness.run();
harness.fit_contents();
harness.snapshot(format!(
"image_blending/image_{theme}_x{pixels_per_point:.2}",
theme = match theme {
egui::Theme::Dark => "dark",
egui::Theme::Light => "light",
}
));
}
}
}