use bevy::prelude::*;
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_systems(Startup, setup)
.run();
}
fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
commands.spawn(Camera2dBundle::default());
let text = "\nfirst line\nsecond line\nthird line\n";
commands.spawn(TextBundle {
text: Text::from_section(
text.to_string(),
TextStyle {
font: asset_server.load("fonts/FiraSans-Bold.ttf"),
font_size: 60.0,
color: Color::YELLOW,
},
),
style: Style {
position_type: PositionType::Absolute,
..Default::default()
},
background_color: BackgroundColor(Color::RED),
..Default::default()
});
}
For this example bevy 0.10.1 showed 3 lines:
first line
second line
third line
bevy 0.11 shows:
first line
second line
<empty line>
It seems like the newline character at the starts is being a wrench in the whole text calculation and there are even more, even weirder bugs that I can follow up with that also have the newline char at the start. I did a git bisect and I got this commit/PR as the breaking change: https://github.com/bevyengine/bevy/pull/7779/files
Any text experts here that might know what this might be about?