diff --git a/examples/todos/snapshots/creates_a_new_task-linux.sha256 b/examples/todos/snapshots/creates_a_new_task-linux.sha256 index 9291711e44..15efcd7791 100644 --- a/examples/todos/snapshots/creates_a_new_task-linux.sha256 +++ b/examples/todos/snapshots/creates_a_new_task-linux.sha256 @@ -1 +1 @@ -e0b1f2e0c0af6324eb45fde8e82384d16acc2a80a9e157bdf3f42ac6548181cf \ No newline at end of file +a7c2ac4b57f84416812e2134e48fe34db55a757d9176beedf5854a2f69532e32 \ No newline at end of file diff --git a/test/Cargo.toml b/test/Cargo.toml index 47e9be11ac..ff6cb38a37 100644 --- a/test/Cargo.toml +++ b/test/Cargo.toml @@ -15,7 +15,9 @@ workspace = true [dependencies] iced_runtime.workspace = true + iced_renderer.workspace = true +iced_renderer.features = ["fira-sans"] png.workspace = true sha2.workspace = true diff --git a/test/src/lib.rs b/test/src/lib.rs index fa802dea3f..929fd3e961 100644 --- a/test/src/lib.rs +++ b/test/src/lib.rs @@ -16,7 +16,9 @@ use crate::core::theme; use crate::core::time; use crate::core::widget; use crate::core::window; -use crate::core::{Element, Event, Point, Rectangle, Settings, Size, SmolStr}; +use crate::core::{ + Element, Event, Font, Point, Rectangle, Settings, Size, SmolStr, +}; use crate::runtime::user_interface; use crate::runtime::UserInterface; @@ -88,12 +90,17 @@ where ) -> Self { let size = size.into(); + let default_font = match settings.default_font { + Font::DEFAULT => Font::with_name("Fira Sans"), + _ => settings.default_font, + }; + for font in settings.fonts { load_font(font).expect("Font must be valid"); } let mut renderer = - Renderer::new(settings.default_font, settings.default_text_size); + Renderer::new(default_font, settings.default_text_size); let raw = UserInterface::build( element, @@ -409,6 +416,7 @@ impl Snapshot { if path.exists() { let saved_hash = fs::read_to_string(&path)?; + dbg!(&path, &hash, &saved_hash); Ok(hash == saved_hash) } else {