-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Text is rendered with visibly incorrect offsets #283
Comments
I think this has to do with us "offsetting" the text from "bottom" to "top" instead of from "top" to "bottom". I chose to go buttom->up because the bottom is where our origin is, but we might need to rethink this. Here is how ab_glyph does typesetting in their examples: https://github.com/alexheretic/ab-glyph/blob/master/dev/examples/image.rs |
TBH, the current "wavy" rendering looks kinda cute. I like the effect. ;) That said, ofc this is a bug and should be fixed. |
the scene example is now fixed with #725, but there's still issue of wavy test... issue gets more noticeable with smaller text size (below 35 is more visible) Code to display text exampleuse bevy::prelude::*;
fn main() {
App::build()
.add_default_plugins()
.add_startup_system(setup.system())
.run();
}
fn setup(
mut commands: Commands,
asset_server: Res<AssetServer>,
mut materials: ResMut<Assets<ColorMaterial>>,
) {
commands
// 2d camera
.spawn(UiCameraComponents::default());
commands.spawn(NodeComponents {
style: Style {
flex_direction: FlexDirection::Column,
..Default::default()
},
material: materials.add(Color::NONE.into()),
..Default::default()
});
commands.with_children(|container| {
for i in 0..10 {
let size = (20 + i * 5) as f32;
container
.spawn(TextComponents {
style: Style {
size: Size {
height: Val::Px(size + 10.),
..Default::default()
},
..Default::default()
},
text: Text {
value: format!("{}: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor.", size),
font: asset_server.load("fonts/FiraSans-Bold.ttf"),
style: TextStyle {
font_size: size ,
color: Color::WHITE,
},
},
..Default::default()
});
}
});
} |
Arg nice catch. We should definitely leave this open. |
Resolved by #765 |
This is clearly visible in the "scene" example. It is less visible for "smaller" text.
The text was updated successfully, but these errors were encountered: