From 522d82b21a4485d7ca70d0d1e05c1a0dc6a686bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tero=20Laxstr=C3=B6m?= Date: Tue, 17 Sep 2024 02:14:37 +0300 Subject: [PATCH] Fixing text sizes for examples (#15190) # Objective - Fixes #14265 ## Solution - Go through Pixel Eagle examples (and examples all in all) - If default size is used it is usually left there - If size of font is touched try dividing with 1.2 and round it to nearest whole number ## Testing - Run example before and after - Make sure examples text are readable or like before cosmic-text change --- ## Showcase Before: ![image](https://github.com/user-attachments/assets/beb2d5af-d1ee-4c2c-89c4-8e59c53b53b4) After: ![image](https://github.com/user-attachments/assets/fef28a8d-dc26-4e0e-9870-6b216de906e8) --- examples/2d/text2d.rs | 4 ++-- examples/2d/texture_atlas.rs | 4 ++-- examples/3d/color_grading.rs | 2 +- examples/3d/load_gltf_extras.rs | 2 +- examples/3d/pbr.rs | 6 ++--- examples/asset/multi_asset_sync.rs | 2 +- examples/camera/first_person_view_model.rs | 5 +--- examples/dev_tools/fps_overlay.rs | 7 ++---- examples/games/alien_cake_addict.rs | 4 ++-- examples/games/breakout.rs | 2 +- examples/games/desk_toy.rs | 2 +- examples/games/game_menu.rs | 18 +++++++------- examples/games/loading_screen.rs | 4 ++-- examples/games/stepping.rs | 2 +- examples/scene/scene.rs | 2 +- examples/state/computed_states.rs | 20 ++++++++-------- examples/state/custom_transitions.rs | 2 +- examples/state/states.rs | 2 +- examples/state/sub_states.rs | 4 ++-- examples/time/virtual_time.rs | 2 +- examples/tools/gamepad_viewer.rs | 4 ++-- examples/ui/button.rs | 2 +- examples/ui/font_atlas_debug.rs | 2 +- examples/ui/grid.rs | 2 +- examples/ui/overflow_debug.rs | 2 +- examples/ui/relative_cursor_position.rs | 2 +- examples/ui/size_constraints.rs | 2 +- examples/ui/text.rs | 8 +++---- examples/ui/text_debug.rs | 28 +++++++++++----------- examples/ui/text_wrap_debug.rs | 2 +- examples/ui/transparency_ui.rs | 4 ++-- examples/ui/ui.rs | 4 ++-- examples/ui/ui_scaling.rs | 2 +- examples/ui/ui_texture_atlas_slice.rs | 2 +- examples/ui/ui_texture_slice.rs | 2 +- examples/ui/window_fallthrough.rs | 2 +- examples/window/scale_factor_override.rs | 2 +- examples/window/window_resizing.rs | 2 +- 38 files changed, 82 insertions(+), 88 deletions(-) diff --git a/examples/2d/text2d.rs b/examples/2d/text2d.rs index a420c16e9c..b7bfe22474 100644 --- a/examples/2d/text2d.rs +++ b/examples/2d/text2d.rs @@ -36,7 +36,7 @@ fn setup(mut commands: Commands, asset_server: Res) { let font = asset_server.load("fonts/FiraSans-Bold.ttf"); let text_style = TextStyle { font: font.clone(), - font_size: 60.0, + font_size: 50.0, ..default() }; let text_justification = JustifyText::Center; @@ -72,7 +72,7 @@ fn setup(mut commands: Commands, asset_server: Res) { // Demonstrate text wrapping let slightly_smaller_text_style = TextStyle { font, - font_size: 42.0, + font_size: 35.0, ..default() }; let box_size = Vec2::new(300.0, 200.0); diff --git a/examples/2d/texture_atlas.rs b/examples/2d/texture_atlas.rs index 59952f8761..0bb8615f4a 100644 --- a/examples/2d/texture_atlas.rs +++ b/examples/2d/texture_atlas.rs @@ -123,7 +123,7 @@ fn setup( // padding label text style let text_style: TextStyle = TextStyle { font: font.clone(), - font_size: 50.0, + font_size: 42.0, ..default() }; @@ -172,7 +172,7 @@ fn setup( // label text style let sampling_label_style = TextStyle { font, - font_size: 30.0, + font_size: 25.0, ..default() }; diff --git a/examples/3d/color_grading.rs b/examples/3d/color_grading.rs index 30275d7b97..1e8d8b5267 100644 --- a/examples/3d/color_grading.rs +++ b/examples/3d/color_grading.rs @@ -344,7 +344,7 @@ fn add_text<'a>( label, TextStyle { font: font.clone(), - font_size: 18.0, + font_size: 15.0, color, }, )) diff --git a/examples/3d/load_gltf_extras.rs b/examples/3d/load_gltf_extras.rs index 4cbfcd3929..64ea8ec409 100644 --- a/examples/3d/load_gltf_extras.rs +++ b/examples/3d/load_gltf_extras.rs @@ -42,7 +42,7 @@ fn setup(mut commands: Commands, asset_server: Res) { TextBundle::from_section( "", TextStyle { - font_size: 18., + font_size: 15., ..default() }, ) diff --git a/examples/3d/pbr.rs b/examples/3d/pbr.rs index 021dd06ac8..5a25f99fca 100644 --- a/examples/3d/pbr.rs +++ b/examples/3d/pbr.rs @@ -66,7 +66,7 @@ fn setup( TextBundle::from_section( "Perceptual Roughness", TextStyle { - font_size: 36.0, + font_size: 30.0, ..default() }, ) @@ -82,7 +82,7 @@ fn setup( text: Text::from_section( "Metallic", TextStyle { - font_size: 36.0, + font_size: 30.0, ..default() }, ), @@ -103,7 +103,7 @@ fn setup( TextBundle::from_section( "Loading Environment Map...", TextStyle { - font_size: 36.0, + font_size: 30.0, ..default() }, ) diff --git a/examples/asset/multi_asset_sync.rs b/examples/asset/multi_asset_sync.rs index 2b2386dad3..f74de5f747 100644 --- a/examples/asset/multi_asset_sync.rs +++ b/examples/asset/multi_asset_sync.rs @@ -186,7 +186,7 @@ fn setup_ui(mut commands: Commands) { sections: vec![TextSection { value: "Loading...".to_owned(), style: TextStyle { - font_size: 64.0, + font_size: 53.0, color: Color::BLACK, ..Default::default() }, diff --git a/examples/camera/first_person_view_model.rs b/examples/camera/first_person_view_model.rs index dcc3df459a..d3d30fc878 100644 --- a/examples/camera/first_person_view_model.rs +++ b/examples/camera/first_person_view_model.rs @@ -229,10 +229,7 @@ fn spawn_text(mut commands: Commands) { "Press arrow up to decrease the FOV of the world model.\n", "Press arrow down to increase the FOV of the world model." ), - TextStyle { - font_size: 25.0, - ..default() - }, + TextStyle::default(), )); }); } diff --git a/examples/dev_tools/fps_overlay.rs b/examples/dev_tools/fps_overlay.rs index a2718ecc3c..d5cc58ced7 100644 --- a/examples/dev_tools/fps_overlay.rs +++ b/examples/dev_tools/fps_overlay.rs @@ -13,7 +13,7 @@ fn main() { config: FpsOverlayConfig { text_config: TextStyle { // Here we define size of our overlay - font_size: 50.0, + font_size: 42.0, // We can also change color of the overlay color: Color::srgb(0.0, 1.0, 0.0), // If we want, we can use a custom font @@ -49,10 +49,7 @@ fn setup(mut commands: Commands) { "Press 1 to change color of the overlay.\n", "Press 2 to change size of the overlay." ), - TextStyle { - font_size: 25.0, - ..default() - }, + TextStyle::default(), )); }); } diff --git a/examples/games/alien_cake_addict.rs b/examples/games/alien_cake_addict.rs index fa1b0543a9..a68efa4a64 100644 --- a/examples/games/alien_cake_addict.rs +++ b/examples/games/alien_cake_addict.rs @@ -180,7 +180,7 @@ fn setup(mut commands: Commands, asset_server: Res, mut game: ResMu TextBundle::from_section( "Score:", TextStyle { - font_size: 40.0, + font_size: 33.0, color: Color::srgb(0.5, 0.5, 1.0), ..default() }, @@ -414,7 +414,7 @@ fn display_score(mut commands: Commands, game: Res) { parent.spawn(TextBundle::from_section( format!("Cake eaten: {}", game.cake_eaten), TextStyle { - font_size: 80.0, + font_size: 67.0, color: Color::srgb(0.5, 0.5, 1.0), ..default() }, diff --git a/examples/games/breakout.rs b/examples/games/breakout.rs index 1fe1cb17c3..f6f690b1e4 100644 --- a/examples/games/breakout.rs +++ b/examples/games/breakout.rs @@ -40,7 +40,7 @@ const GAP_BETWEEN_BRICKS: f32 = 5.0; const GAP_BETWEEN_BRICKS_AND_CEILING: f32 = 20.0; const GAP_BETWEEN_BRICKS_AND_SIDES: f32 = 20.0; -const SCOREBOARD_FONT_SIZE: f32 = 40.0; +const SCOREBOARD_FONT_SIZE: f32 = 33.0; const SCOREBOARD_TEXT_PADDING: Val = Val::Px(5.0); const BACKGROUND_COLOR: Color = Color::srgb(0.9, 0.9, 0.9); diff --git a/examples/games/desk_toy.rs b/examples/games/desk_toy.rs index 3147694176..68e5278186 100644 --- a/examples/games/desk_toy.rs +++ b/examples/games/desk_toy.rs @@ -110,7 +110,7 @@ fn setup( let font = asset_server.load("fonts/FiraSans-Bold.ttf"); let text_style = TextStyle { font: font.clone(), - font_size: 30.0, + font_size: 25.0, ..default() }; commands.spawn(( diff --git a/examples/games/game_menu.rs b/examples/games/game_menu.rs index 5e64a164c4..76d44ad368 100644 --- a/examples/games/game_menu.rs +++ b/examples/games/game_menu.rs @@ -179,7 +179,7 @@ mod game { TextBundle::from_section( "Will be back to the menu shortly...", TextStyle { - font_size: 80.0, + font_size: 67.0, color: TEXT_COLOR, ..default() }, @@ -194,7 +194,7 @@ mod game { TextSection::new( format!("quality: {:?}", *display_quality), TextStyle { - font_size: 60.0, + font_size: 50.0, color: BLUE.into(), ..default() }, @@ -202,7 +202,7 @@ mod game { TextSection::new( " - ", TextStyle { - font_size: 60.0, + font_size: 50.0, color: TEXT_COLOR, ..default() }, @@ -210,7 +210,7 @@ mod game { TextSection::new( format!("volume: {:?}", *volume), TextStyle { - font_size: 60.0, + font_size: 50.0, color: LIME.into(), ..default() }, @@ -401,7 +401,7 @@ mod menu { ..default() }; let button_text_style = TextStyle { - font_size: 40.0, + font_size: 33.0, color: TEXT_COLOR, ..default() }; @@ -437,7 +437,7 @@ mod menu { TextBundle::from_section( "Bevy Game Menu UI", TextStyle { - font_size: 80.0, + font_size: 67.0, color: TEXT_COLOR, ..default() }, @@ -527,7 +527,7 @@ mod menu { }; let button_text_style = TextStyle { - font_size: 40.0, + font_size: 33.0, color: TEXT_COLOR, ..default() }; @@ -593,7 +593,7 @@ mod menu { ..default() }; let button_text_style = TextStyle { - font_size: 40.0, + font_size: 33.0, color: TEXT_COLOR, ..default() }; @@ -697,7 +697,7 @@ mod menu { ..default() }; let button_text_style = TextStyle { - font_size: 40.0, + font_size: 33.0, color: TEXT_COLOR, ..default() }; diff --git a/examples/games/loading_screen.rs b/examples/games/loading_screen.rs index d695d094f1..a90b0e769b 100644 --- a/examples/games/loading_screen.rs +++ b/examples/games/loading_screen.rs @@ -78,7 +78,7 @@ fn setup(mut commands: Commands) { // Spawns the UI that will show the user prompts. let text_style = TextStyle { - font_size: 50.0, + font_size: 42.0, ..default() }; commands @@ -266,7 +266,7 @@ struct LoadingScreen; // Spawns the necessary components for the loading screen. fn load_loading_screen(mut commands: Commands) { let text_style = TextStyle { - font_size: 80.0, + font_size: 67.0, ..default() }; diff --git a/examples/games/stepping.rs b/examples/games/stepping.rs index be36551d02..b25ceda934 100644 --- a/examples/games/stepping.rs +++ b/examples/games/stepping.rs @@ -193,7 +193,7 @@ fn build_stepping_hint(mut commands: Commands) { commands.spawn((TextBundle::from_sections([TextSection::new( hint_text, TextStyle { - font_size: 18.0, + font_size: 15.0, color: FONT_COLOR, ..default() }, diff --git a/examples/scene/scene.rs b/examples/scene/scene.rs index e5f18d1bdd..1316a0a5c0 100644 --- a/examples/scene/scene.rs +++ b/examples/scene/scene.rs @@ -153,7 +153,7 @@ fn infotext_system(mut commands: Commands) { TextBundle::from_section( "Nothing to see in this window! Check the console output!", TextStyle { - font_size: 50.0, + font_size: 42.0, ..default() }, ) diff --git a/examples/state/computed_states.rs b/examples/state/computed_states.rs index aeae9612ed..fca6a47799 100644 --- a/examples/state/computed_states.rs +++ b/examples/state/computed_states.rs @@ -371,7 +371,7 @@ mod ui { parent.spawn(TextBundle::from_section( "Play", TextStyle { - font_size: 40.0, + font_size: 33.0, color: Color::srgb(0.9, 0.9, 0.9), ..default() }, @@ -403,7 +403,7 @@ mod ui { parent.spawn(TextBundle::from_section( "Tutorial", TextStyle { - font_size: 40.0, + font_size: 33.0, color: Color::srgb(0.9, 0.9, 0.9), ..default() }, @@ -504,7 +504,7 @@ mod ui { parent.spawn(TextBundle::from_section( "Paused", TextStyle { - font_size: 40.0, + font_size: 33.0, color: Color::srgb(0.9, 0.9, 0.9), ..default() }, @@ -536,7 +536,7 @@ mod ui { parent.spawn(TextBundle::from_section( "TURBO MODE", TextStyle { - font_size: 40.0, + font_size: 33.0, color: Color::srgb(0.9, 0.3, 0.1), ..default() }, @@ -578,7 +578,7 @@ mod ui { parent.spawn(TextBundle::from_section( "Move the bevy logo with the arrow keys", TextStyle { - font_size: 40.0, + font_size: 33.0, color: Color::srgb(0.3, 0.3, 0.7), ..default() }, @@ -586,7 +586,7 @@ mod ui { parent.spawn(TextBundle::from_section( "Press T to enter TURBO MODE", TextStyle { - font_size: 40.0, + font_size: 33.0, color: Color::srgb(0.3, 0.3, 0.7), ..default() }, @@ -595,7 +595,7 @@ mod ui { parent.spawn(TextBundle::from_section( "Press SPACE to pause", TextStyle { - font_size: 40.0, + font_size: 33.0, color: Color::srgb(0.3, 0.3, 0.7), ..default() }, @@ -604,7 +604,7 @@ mod ui { parent.spawn(TextBundle::from_section( "Press ESCAPE to return to the menu", TextStyle { - font_size: 40.0, + font_size: 33.0, color: Color::srgb(0.3, 0.3, 0.7), ..default() }, @@ -635,7 +635,7 @@ mod ui { parent.spawn(TextBundle::from_section( "Press SPACE to resume", TextStyle { - font_size: 40.0, + font_size: 33.0, color: Color::srgb(0.3, 0.3, 0.7), ..default() }, @@ -644,7 +644,7 @@ mod ui { parent.spawn(TextBundle::from_section( "Press ESCAPE to return to the menu", TextStyle { - font_size: 40.0, + font_size: 33.0, color: Color::srgb(0.3, 0.3, 0.7), ..default() }, diff --git a/examples/state/custom_transitions.rs b/examples/state/custom_transitions.rs index f5ff3204d6..0f8d0ca2f5 100644 --- a/examples/state/custom_transitions.rs +++ b/examples/state/custom_transitions.rs @@ -276,7 +276,7 @@ fn setup_menu(mut commands: Commands) { parent.spawn(TextBundle::from_section( "Play", TextStyle { - font_size: 40.0, + font_size: 33.0, color: Color::srgb(0.9, 0.9, 0.9), ..default() }, diff --git a/examples/state/states.rs b/examples/state/states.rs index ec82b72190..91942268f0 100644 --- a/examples/state/states.rs +++ b/examples/state/states.rs @@ -81,7 +81,7 @@ fn setup_menu(mut commands: Commands) { parent.spawn(TextBundle::from_section( "Play", TextStyle { - font_size: 40.0, + font_size: 33.0, color: Color::srgb(0.9, 0.9, 0.9), ..default() }, diff --git a/examples/state/sub_states.rs b/examples/state/sub_states.rs index db878dcd16..42efb04429 100644 --- a/examples/state/sub_states.rs +++ b/examples/state/sub_states.rs @@ -186,7 +186,7 @@ mod ui { parent.spawn(TextBundle::from_section( "Play", TextStyle { - font_size: 40.0, + font_size: 33.0, color: Color::srgb(0.9, 0.9, 0.9), ..default() }, @@ -241,7 +241,7 @@ mod ui { parent.spawn(TextBundle::from_section( "Paused", TextStyle { - font_size: 40.0, + font_size: 33.0, color: Color::srgb(0.9, 0.9, 0.9), ..default() }, diff --git a/examples/time/virtual_time.rs b/examples/time/virtual_time.rs index 52cec835f8..4398b2c2b5 100644 --- a/examples/time/virtual_time.rs +++ b/examples/time/virtual_time.rs @@ -80,7 +80,7 @@ fn setup(mut commands: Commands, asset_server: Res, mut time: ResMu )); // info UI - let font_size = 40.; + let font_size = 33.; commands .spawn(NodeBundle { diff --git a/examples/tools/gamepad_viewer.rs b/examples/tools/gamepad_viewer.rs index cfcb51529f..7be76fe50a 100644 --- a/examples/tools/gamepad_viewer.rs +++ b/examples/tools/gamepad_viewer.rs @@ -311,7 +311,7 @@ fn setup_sticks( }); // text let style = TextStyle { - font_size: 16., + font_size: 13., ..default() }; parent.spawn(( @@ -392,7 +392,7 @@ fn setup_triggers( text: Text::from_section( format!("{:.3}", 0.), TextStyle { - font_size: 16., + font_size: 13., ..default() }, ), diff --git a/examples/ui/button.rs b/examples/ui/button.rs index 0a984f7a50..39ce4c51bd 100644 --- a/examples/ui/button.rs +++ b/examples/ui/button.rs @@ -87,7 +87,7 @@ fn setup(mut commands: Commands, asset_server: Res) { "Button", TextStyle { font: asset_server.load("fonts/FiraSans-Bold.ttf"), - font_size: 40.0, + font_size: 33.0, color: Color::srgb(0.9, 0.9, 0.9), }, )); diff --git a/examples/ui/font_atlas_debug.rs b/examples/ui/font_atlas_debug.rs index 12da643fea..4a713728d6 100644 --- a/examples/ui/font_atlas_debug.rs +++ b/examples/ui/font_atlas_debug.rs @@ -100,7 +100,7 @@ fn setup(mut commands: Commands, asset_server: Res, mut state: ResM "a", TextStyle { font: font_handle, - font_size: 60.0, + font_size: 50.0, color: YELLOW.into(), }, )); diff --git a/examples/ui/grid.rs b/examples/ui/grid.rs index dae25bdbcf..065f982543 100644 --- a/examples/ui/grid.rs +++ b/examples/ui/grid.rs @@ -147,7 +147,7 @@ fn spawn_layout(mut commands: Commands, asset_server: Res) { "A paragraph of text which ought to wrap nicely. A paragraph of text which ought to wrap nicely. A paragraph of text which ought to wrap nicely. A paragraph of text which ought to wrap nicely. A paragraph of text which ought to wrap nicely. A paragraph of text which ought to wrap nicely. A paragraph of text which ought to wrap nicely.", TextStyle { font: font.clone(), - font_size: 16.0, + font_size: 13.0, ..default() }, )); diff --git a/examples/ui/overflow_debug.rs b/examples/ui/overflow_debug.rs index a71b32a157..5f287e236e 100644 --- a/examples/ui/overflow_debug.rs +++ b/examples/ui/overflow_debug.rs @@ -166,7 +166,7 @@ fn spawn_text( "Bevy", TextStyle { font: asset_server.load("fonts/FiraSans-Bold.ttf"), - font_size: 120.0, + font_size: 100.0, ..default() }, )); diff --git a/examples/ui/relative_cursor_position.rs b/examples/ui/relative_cursor_position.rs index 98d43edd51..4686c5ede5 100644 --- a/examples/ui/relative_cursor_position.rs +++ b/examples/ui/relative_cursor_position.rs @@ -59,7 +59,7 @@ fn setup(mut commands: Commands, asset_server: Res) { "(0.0, 0.0)", TextStyle { font: asset_server.load("fonts/FiraSans-Bold.ttf"), - font_size: 40.0, + font_size: 33.0, color: Color::srgb(0.9, 0.9, 0.9), }, ), diff --git a/examples/ui/size_constraints.rs b/examples/ui/size_constraints.rs index 69ebb646fa..d960edc52a 100644 --- a/examples/ui/size_constraints.rs +++ b/examples/ui/size_constraints.rs @@ -44,7 +44,7 @@ fn setup(mut commands: Commands, asset_server: Res) { let text_style = TextStyle { font: asset_server.load("fonts/FiraSans-Bold.ttf"), - font_size: 40.0, + font_size: 33.0, color: Color::srgb(0.9, 0.9, 0.9), }; diff --git a/examples/ui/text.rs b/examples/ui/text.rs index 197c8ddf4c..ec6ace155c 100644 --- a/examples/ui/text.rs +++ b/examples/ui/text.rs @@ -37,7 +37,7 @@ fn setup(mut commands: Commands, asset_server: Res) { TextStyle { // This font is loaded and will be used instead of the default font. font: asset_server.load("fonts/FiraSans-Bold.ttf"), - font_size: 80.0, + font_size: 67.0, ..default() }, ) // Set the justification of the Text @@ -61,13 +61,13 @@ fn setup(mut commands: Commands, asset_server: Res) { TextStyle { // This font is loaded and will be used instead of the default font. font: asset_server.load("fonts/FiraSans-Bold.ttf"), - font_size: 50.0, + font_size: 42.0, ..default() }, ), TextSection::from_style(if cfg!(feature = "default_font") { TextStyle { - font_size: 40.0, + font_size: 33.0, color: GOLD.into(), // If no font is specified, the default font (a minimal subset of FiraMono) will be used. ..default() @@ -76,7 +76,7 @@ fn setup(mut commands: Commands, asset_server: Res) { // "default_font" feature is unavailable, load a font to use instead. TextStyle { font: asset_server.load("fonts/FiraMono-Medium.ttf"), - font_size: 40.0, + font_size: 33.0, color: GOLD.into(), } }), diff --git a/examples/ui/text_debug.rs b/examples/ui/text_debug.rs index e2f596c352..8bea82643e 100644 --- a/examples/ui/text_debug.rs +++ b/examples/ui/text_debug.rs @@ -60,7 +60,7 @@ fn infotext_system(mut commands: Commands, asset_server: Res) { "This is\ntext with\nline breaks\nin the top left.", TextStyle { font: font.clone(), - font_size: 30.0, + font_size: 25.0, ..default() }, ) @@ -68,7 +68,7 @@ fn infotext_system(mut commands: Commands, asset_server: Res) { builder.spawn(TextBundle::from_section( "This text is right-justified. The `JustifyText` component controls the horizontal alignment of the lines of multi-line text relative to each other, and does not affect the text node's position in the UI layout.", TextStyle { font: font.clone(), - font_size: 30.0, + font_size: 25.0, color: YELLOW.into(), }, ) @@ -83,7 +83,7 @@ fn infotext_system(mut commands: Commands, asset_server: Res) { "This\ntext has\nline breaks and also a set width in the bottom left.", TextStyle { font: font.clone(), - font_size: 30.0, + font_size: 25.0, ..default() }, ) @@ -110,7 +110,7 @@ fn infotext_system(mut commands: Commands, asset_server: Res) { "This text is very long, has a limited width, is center-justified, is positioned in the top right and is also colored pink.", TextStyle { font: font.clone(), - font_size: 40.0, + font_size: 33.0, color: Color::srgb(0.8, 0.2, 0.7), }, ) @@ -126,7 +126,7 @@ fn infotext_system(mut commands: Commands, asset_server: Res) { "This text is left-justified and is vertically positioned to distribute the empty space equally above and below it.", TextStyle { font: font.clone(), - font_size: 35.0, + font_size: 29.0, color: YELLOW.into(), }, ) @@ -142,7 +142,7 @@ fn infotext_system(mut commands: Commands, asset_server: Res) { "This text is fully justified and is positioned in the same way.", TextStyle { font: font.clone(), - font_size: 35.0, + font_size: 29.0, color: GREEN_YELLOW.into(), }, ) @@ -159,7 +159,7 @@ fn infotext_system(mut commands: Commands, asset_server: Res) { "", TextStyle { font: font.clone(), - font_size: 25.0, + font_size: 21.0, ..default() }, ), @@ -167,7 +167,7 @@ fn infotext_system(mut commands: Commands, asset_server: Res) { "\nThis text changes in the bottom right", TextStyle { font: font.clone(), - font_size: 25.0, + font_size: 21.0, ..default() }, ), @@ -183,33 +183,33 @@ fn infotext_system(mut commands: Commands, asset_server: Res) { "\nThis text changes in the bottom right - ", TextStyle { font: font.clone(), - font_size: 25.0, + font_size: 21.0, color: RED.into(), }, ), TextSection::from_style(TextStyle { font: font.clone(), - font_size: 25.0, + font_size: 21.0, color: ORANGE_RED.into(), }), TextSection::new( " fps, ", TextStyle { font: font.clone(), - font_size: 12.0, + font_size: 10.0, color: YELLOW.into(), }, ), TextSection::from_style(TextStyle { font: font.clone(), - font_size: 25.0, + font_size: 21.0, color: LIME.into(), }), TextSection::new( " ms/frame", TextStyle { font: font.clone(), - font_size: 50.0, + font_size: 42.0, color: BLUE.into(), }, ), @@ -217,7 +217,7 @@ fn infotext_system(mut commands: Commands, asset_server: Res) { " this text has negative fontsize", TextStyle { font: font.clone(), - font_size: -50.0, + font_size: -42.0, color: BLUE.into(), }, ), diff --git a/examples/ui/text_wrap_debug.rs b/examples/ui/text_wrap_debug.rs index f5ae2ed2b3..3378a8cbc1 100644 --- a/examples/ui/text_wrap_debug.rs +++ b/examples/ui/text_wrap_debug.rs @@ -50,7 +50,7 @@ fn spawn(mut commands: Commands, asset_server: Res) { let text_style = TextStyle { font: asset_server.load("fonts/FiraSans-Bold.ttf"), - font_size: 14.0, + font_size: 12.0, ..default() }; diff --git a/examples/ui/transparency_ui.rs b/examples/ui/transparency_ui.rs index f83d2ba215..abe915ecf7 100644 --- a/examples/ui/transparency_ui.rs +++ b/examples/ui/transparency_ui.rs @@ -45,7 +45,7 @@ fn setup(mut commands: Commands, asset_server: Res) { "Button 1", TextStyle { font: font_handle.clone(), - font_size: 40.0, + font_size: 33.0, // Alpha channel of the color controls transparency. color: Color::srgba(1.0, 1.0, 1.0, 0.2), }, @@ -71,7 +71,7 @@ fn setup(mut commands: Commands, asset_server: Res) { "Button 2", TextStyle { font: font_handle.clone(), - font_size: 40.0, + font_size: 33.0, // Alpha channel of the color controls transparency. color: Color::srgba(1.0, 1.0, 1.0, 0.2), }, diff --git a/examples/ui/ui.rs b/examples/ui/ui.rs index fec5bb825f..9887d42270 100644 --- a/examples/ui/ui.rs +++ b/examples/ui/ui.rs @@ -76,7 +76,7 @@ fn setup(mut commands: Commands, asset_server: Res) { "Text Example", TextStyle { font: asset_server.load("fonts/FiraSans-Bold.ttf"), - font_size: 30.0, + font_size: 25.0, ..default() }, ), @@ -132,7 +132,7 @@ fn setup(mut commands: Commands, asset_server: Res) { "Scrolling list", TextStyle { font: asset_server.load("fonts/FiraSans-Bold.ttf"), - font_size: 25., + font_size: 21., ..default() }, ), diff --git a/examples/ui/ui_scaling.rs b/examples/ui/ui_scaling.rs index e3adea12a0..6a20df95d5 100644 --- a/examples/ui/ui_scaling.rs +++ b/examples/ui/ui_scaling.rs @@ -24,7 +24,7 @@ fn setup(mut commands: Commands, asset_server: Res) { commands.spawn(Camera2dBundle::default()); let text_style = TextStyle { - font_size: 16., + font_size: 13., color: Color::BLACK, ..default() }; diff --git a/examples/ui/ui_texture_atlas_slice.rs b/examples/ui/ui_texture_atlas_slice.rs index b4fa75cc2a..319d4069cc 100644 --- a/examples/ui/ui_texture_atlas_slice.rs +++ b/examples/ui/ui_texture_atlas_slice.rs @@ -106,7 +106,7 @@ fn setup( "Button", TextStyle { font: asset_server.load("fonts/FiraSans-Bold.ttf"), - font_size: 40.0, + font_size: 33.0, color: Color::srgb(0.9, 0.9, 0.9), }, )); diff --git a/examples/ui/ui_texture_slice.rs b/examples/ui/ui_texture_slice.rs index 1f48a63b7c..3ea49a1aac 100644 --- a/examples/ui/ui_texture_slice.rs +++ b/examples/ui/ui_texture_slice.rs @@ -90,7 +90,7 @@ fn setup(mut commands: Commands, asset_server: Res) { "Button", TextStyle { font: asset_server.load("fonts/FiraSans-Bold.ttf"), - font_size: 40.0, + font_size: 33.0, color: Color::srgb(0.9, 0.9, 0.9), }, )); diff --git a/examples/ui/window_fallthrough.rs b/examples/ui/window_fallthrough.rs index 9b56d1131e..8d3d75c8e9 100644 --- a/examples/ui/window_fallthrough.rs +++ b/examples/ui/window_fallthrough.rs @@ -33,7 +33,7 @@ fn setup(mut commands: Commands, asset_server: Res) { "Hit 'P' then scroll/click around!", TextStyle { font: asset_server.load("fonts/FiraSans-Bold.ttf"), - font_size: 100.0, // Nice and big so you can see it! + font_size: 83.0, // Nice and big so you can see it! ..default() }, ) diff --git a/examples/window/scale_factor_override.rs b/examples/window/scale_factor_override.rs index b814dac6f4..6d0ca8d375 100644 --- a/examples/window/scale_factor_override.rs +++ b/examples/window/scale_factor_override.rs @@ -56,7 +56,7 @@ fn setup(mut commands: Commands) { TextBundle::from_section( "Example text", TextStyle { - font_size: 30.0, + font_size: 25.0, ..default() }, ) diff --git a/examples/window/window_resizing.rs b/examples/window/window_resizing.rs index df649866a7..e967a95336 100644 --- a/examples/window/window_resizing.rs +++ b/examples/window/window_resizing.rs @@ -48,7 +48,7 @@ fn setup_ui(mut commands: Commands) { TextBundle::from_section( "Resolution", TextStyle { - font_size: 50.0, + font_size: 42.0, ..default() }, ),