diff --git a/compositor_render/fonts/Inter_18pt-Bold.ttf b/compositor_render/fonts/Inter_18pt-Bold.ttf new file mode 100644 index 000000000..cd13f60ce Binary files /dev/null and b/compositor_render/fonts/Inter_18pt-Bold.ttf differ diff --git a/compositor_render/src/transformations/text_renderer.rs b/compositor_render/src/transformations/text_renderer.rs index a3ae0810b..4d5efd959 100644 --- a/compositor_render/src/transformations/text_renderer.rs +++ b/compositor_render/src/transformations/text_renderer.rs @@ -264,6 +264,11 @@ impl TextRendererCtx { .load_font_source(Source::Binary(Arc::new(include_bytes!( "../../fonts/Inter_18pt-Italic.ttf" )))); + font_system + .db_mut() + .load_font_source(Source::Binary(Arc::new(include_bytes!( + "../../fonts/Inter_18pt-Bold.ttf" + )))); Self { font_system: Mutex::new(font_system), swash_cache: Mutex::new(SwashCache::new()), diff --git a/snapshot_tests/snapshots b/snapshot_tests/snapshots index fd3ef30ac..d8becda39 160000 --- a/snapshot_tests/snapshots +++ b/snapshot_tests/snapshots @@ -1 +1 @@ -Subproject commit fd3ef30acb19aded98515cad20a16b0c5c89d7a9 +Subproject commit d8becda39b0c167a7f4ddee67878d97f75ffad8e diff --git a/snapshot_tests/text/align_center.scene.json b/snapshot_tests/text/align_center.scene.json index 5223887dd..afbaea49b 100644 --- a/snapshot_tests/text/align_center.scene.json +++ b/snapshot_tests/text/align_center.scene.json @@ -8,7 +8,7 @@ "type": "text", "text": "Example text", "font_size": 100, - "font_family": "Verdana", + "font_family": "Inter", "align": "center", "width": 1000, "height": 200 diff --git a/snapshot_tests/text/align_right.scene.json b/snapshot_tests/text/align_right.scene.json index 6fa3e7372..d72b686f5 100644 --- a/snapshot_tests/text/align_right.scene.json +++ b/snapshot_tests/text/align_right.scene.json @@ -8,7 +8,7 @@ "type": "text", "text": "Example text", "font_size": 100, - "font_family": "Verdana", + "font_family": "Inter", "align": "right", "width": 1000, "height": 200 diff --git a/snapshot_tests/text/bold_text.scene.json b/snapshot_tests/text/bold_text.scene.json index d699a6c35..8c98f7933 100644 --- a/snapshot_tests/text/bold_text.scene.json +++ b/snapshot_tests/text/bold_text.scene.json @@ -8,7 +8,7 @@ "type": "text", "text": "Example text", "font_size": 100, - "font_family": "Verdana", + "font_family": "Inter", "align": "right", "weight": "bold", "width": 1000, diff --git a/snapshot_tests/text/dimensions_fitted.scene.json b/snapshot_tests/text/dimensions_fitted.scene.json index eabb98a38..7dfdb090b 100644 --- a/snapshot_tests/text/dimensions_fitted.scene.json +++ b/snapshot_tests/text/dimensions_fitted.scene.json @@ -8,7 +8,7 @@ "type": "text", "text": "Example text", "font_size": 100, - "font_family": "Verdana", + "font_family": "Inter", "background_color_rgba": "#FF0000FF" } ] diff --git a/snapshot_tests/text/dimensions_fitted_column_with_long_text.scene.json b/snapshot_tests/text/dimensions_fitted_column_with_long_text.scene.json index 3f953ffde..ad911d54e 100644 --- a/snapshot_tests/text/dimensions_fitted_column_with_long_text.scene.json +++ b/snapshot_tests/text/dimensions_fitted_column_with_long_text.scene.json @@ -8,7 +8,7 @@ "type": "text", "text": "Example long text that should be longer that underlaying texture.", "font_size": 30, - "font_family": "Verdana", + "font_family": "Inter", "width": 300 } ] diff --git a/snapshot_tests/text/dimensions_fitted_column_with_short_text.scene.json b/snapshot_tests/text/dimensions_fitted_column_with_short_text.scene.json index 84dda9749..dd4eca462 100644 --- a/snapshot_tests/text/dimensions_fitted_column_with_short_text.scene.json +++ b/snapshot_tests/text/dimensions_fitted_column_with_short_text.scene.json @@ -8,7 +8,7 @@ "type": "text", "text": "Example text", "font_size": 30, - "font_family": "Verdana", + "font_family": "Inter", "width": 300 } ] diff --git a/snapshot_tests/text/dimensions_fixed.scene.json b/snapshot_tests/text/dimensions_fixed.scene.json index e448d8427..a9c5daa60 100644 --- a/snapshot_tests/text/dimensions_fixed.scene.json +++ b/snapshot_tests/text/dimensions_fixed.scene.json @@ -8,7 +8,7 @@ "type": "text", "text": "Example text", "font_size": 100, - "font_family": "Verdana", + "font_family": "Inter", "width": 1000, "height": 200 } diff --git a/snapshot_tests/text/dimensions_fixed_with_overflow.scene.json b/snapshot_tests/text/dimensions_fixed_with_overflow.scene.json index 5efaf64cd..00895a433 100644 --- a/snapshot_tests/text/dimensions_fixed_with_overflow.scene.json +++ b/snapshot_tests/text/dimensions_fixed_with_overflow.scene.json @@ -8,7 +8,7 @@ "type": "text", "text": "Example text", "font_size": 120, - "font_family": "Verdana", + "font_family": "Inter", "width": 640, "height": 80 } diff --git a/snapshot_tests/text/red_text_on_blue_background.scene.json b/snapshot_tests/text/red_text_on_blue_background.scene.json index 5f020d705..3ce59d824 100644 --- a/snapshot_tests/text/red_text_on_blue_background.scene.json +++ b/snapshot_tests/text/red_text_on_blue_background.scene.json @@ -8,7 +8,7 @@ "type": "text", "text": "Example text", "font_size": 50, - "font_family": "Verdana", + "font_family": "Inter", "align": "left", "wrap": "word", "color_rgba": "#FF0000FF", diff --git a/snapshot_tests/text/root_text.scene.json b/snapshot_tests/text/root_text.scene.json index 39f04ee19..ff243b846 100644 --- a/snapshot_tests/text/root_text.scene.json +++ b/snapshot_tests/text/root_text.scene.json @@ -4,7 +4,7 @@ "type": "text", "text": "Example text", "font_size": 100, - "font_family": "Verdana", + "font_family": "Inter", "width": 1000, "height": 200 } diff --git a/snapshot_tests/text/wrap_glyph.scene.json b/snapshot_tests/text/wrap_glyph.scene.json index b38861b65..bbe71ba5b 100644 --- a/snapshot_tests/text/wrap_glyph.scene.json +++ b/snapshot_tests/text/wrap_glyph.scene.json @@ -8,7 +8,7 @@ "type": "text", "text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum id eros non eros dictum scelerisque. Sed vehicula magna et metus fringilla, nec placerat felis elementum. Nullam tincidunt dui id purus egestas, et pulvinar est facilisis.", "font_size": 50, - "font_family": "Verdana", + "font_family": "Inter", "align": "left", "wrap": "glyph", "width": 1000, diff --git a/snapshot_tests/text/wrap_none.scene.json b/snapshot_tests/text/wrap_none.scene.json index 5455b67f8..56af073cc 100644 --- a/snapshot_tests/text/wrap_none.scene.json +++ b/snapshot_tests/text/wrap_none.scene.json @@ -8,7 +8,7 @@ "type": "text", "text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum id eros non eros dictum scelerisque. Sed vehicula magna et metus fringilla, nec placerat felis elementum. Nullam tincidunt dui id purus egestas, et pulvinar est facilisis.", "font_size": 50, - "font_family": "Verdana", + "font_family": "Inter", "align": "left", "wrap": "none", "width": 1000, diff --git a/snapshot_tests/text/wrap_word.scene.json b/snapshot_tests/text/wrap_word.scene.json index 4aef48b6c..8b60251c4 100644 --- a/snapshot_tests/text/wrap_word.scene.json +++ b/snapshot_tests/text/wrap_word.scene.json @@ -8,7 +8,7 @@ "type": "text", "text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum id eros non eros dictum scelerisque. Sed vehicula magna et metus fringilla, nec placerat felis elementum. Nullam tincidunt dui id purus egestas, et pulvinar est facilisis.", "font_size": 50, - "font_family": "Verdana", + "font_family": "Inter", "align": "left", "wrap": "word", "width": 1000, diff --git a/src/snapshot_tests/test_case.rs b/src/snapshot_tests/test_case.rs index 479b81b04..3cd2ce00b 100644 --- a/src/snapshot_tests/test_case.rs +++ b/src/snapshot_tests/test_case.rs @@ -37,7 +37,7 @@ impl Default for TestCase { timestamps: vec![Duration::from_secs(0)], scene_updates: Updates::Scenes(vec![]), only: false, - allowed_error: 20.0, + allowed_error: 1.0, } } } diff --git a/src/snapshot_tests/tests.rs b/src/snapshot_tests/tests.rs index 714799c60..e14460595 100644 --- a/src/snapshot_tests/tests.rs +++ b/src/snapshot_tests/tests.rs @@ -1188,7 +1188,6 @@ fn text_snapshot_tests() -> Vec { include_str!("../../snapshot_tests/text/wrap_glyph.scene.json"), DEFAULT_RESOLUTION, ), - allowed_error: 325.7, ..Default::default() }, TestCase { @@ -1205,7 +1204,6 @@ fn text_snapshot_tests() -> Vec { include_str!("../../snapshot_tests/text/wrap_word.scene.json"), DEFAULT_RESOLUTION, ), - allowed_error: 321.8, ..Default::default() }, TestCase { @@ -1722,7 +1720,6 @@ fn view_snapshot_tests() -> Vec { }, TestCase { name: "view/border_radius_box_shadow_overflow_fit", - only: true, scene_updates: Updates::Scene( include_str!("../../snapshot_tests/view/border_radius_box_shadow_overflow_fit.scene.json"), DEFAULT_RESOLUTION, diff --git a/src/snapshot_tests/utils.rs b/src/snapshot_tests/utils.rs index d79b8cb67..893133f82 100644 --- a/src/snapshot_tests/utils.rs +++ b/src/snapshot_tests/utils.rs @@ -85,7 +85,7 @@ pub(super) fn create_renderer() -> Renderer { stream_fallback_timeout: Duration::from_secs(3), wgpu_features: WgpuFeatures::default(), wgpu_ctx: Some(global_wgpu_ctx(false, Default::default())), - load_system_fonts: true, + load_system_fonts: false, }) .unwrap(); renderer