mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 23:00:04 -04:00
Add snapshot test for text spacing/kerning (#7545)
This commit is contained in:
26
crates/egui_demo_lib/tests/misc.rs
Normal file
26
crates/egui_demo_lib/tests/misc.rs
Normal file
@@ -0,0 +1,26 @@
|
||||
use egui_kittest::Harness;
|
||||
|
||||
#[test]
|
||||
fn test_kerning() {
|
||||
for pixels_per_point in [1.0, 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("Thin spaces: −123 456 789");
|
||||
ui.label("Ligature: fi :)");
|
||||
ui.label("\ttabbed");
|
||||
});
|
||||
harness.run();
|
||||
harness.fit_contents();
|
||||
harness.snapshot(format!(
|
||||
"image_blending/image_{theme}_x{pixels_per_point}",
|
||||
theme = match theme {
|
||||
egui::Theme::Dark => "dark",
|
||||
egui::Theme::Light => "light",
|
||||
}
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user