Skip to content
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 rendering panics in newest version (0.115.0) #283

Open
kaikalii opened this issue Nov 12, 2020 · 0 comments
Open

Text rendering panics in newest version (0.115.0) #283

kaikalii opened this issue Nov 12, 2020 · 0 comments

Comments

@kaikalii
Copy link

With version 0.115.0, this following code panics:

use piston_window::*;

fn main() {
    let mut window: PistonWindow = WindowSettings::new("test", [800; 2]).build().unwrap();
    let mut glyphs = window.load_font("firacode.ttf").unwrap();
    while let Some(event) = window.next() {
        window.draw_2d(&event, |Context { transform, .. }, g, device| {
            clear([0.0, 0.0, 0.0, 1.0], g);
            text(
                [1.0; 4],
                80,
                "Hellow World!",
                &mut glyphs,
                transform.trans(20.0, 100.0),
                g,
            )
            .unwrap();
            glyphs.factory.encoder.flush(device);
        });
    }
}

Looking at the backtrace, the actual panic originates from rusttype. Not sure if this is a problem with piston, rusttype, or the font I am using, but this font did not cause problems in previous versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant