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

On macOS, using a high resolution monitor like the built-in screen, text rendering is incorrect #46

Closed
vtbassmatt opened this issue Jan 13, 2020 · 4 comments · Fixed by #47

Comments

@vtbassmatt
Copy link

vtbassmatt commented Jan 13, 2020

On my Mac (which has a non-high-DPI monitor attached), if I run an rltk app from a terminal on the laptop screen, I get super-tiny font rendering in the wrong place. If I drag the terminal over to the external monitor and then launch the app, everything looks fine.

Laptop screen:
image

External monitor:
image

The code is chapter 1 of the book:

rltk::add_wasm_support!();
use rltk::{Rltk, GameState, Console};

struct State {}
impl GameState for State {
    fn tick(&mut self, ctx : &mut Rltk) {
        ctx.cls();
        ctx.print(1, 1, "Hello Rust World!");
    }
}

fn main() {
    let context = Rltk::init_simple8x8(80, 50, "Hello Rust World", "resources");
    let gs = State{ };
    rltk::main_loop(context, gs);
}
@cpv
Copy link

cpv commented Jan 13, 2020

I'm having the same issue. Additionally if I resize the window on my laptop screen the rendering corrects itself.

@vtbassmatt
Copy link
Author

Actually, now I'm trying it with no monitor attached, and I still get the incorrect rendering on the laptop screen. Updating title.

Like @cpv it fixes the rendering if I tweak the size of the window.

@vtbassmatt vtbassmatt changed the title On macOS with a monitor attached, text rendering is incorrect on laptop screen On macOS, using a high resolution monitor like the built-in screen, text rendering is incorrect Jan 14, 2020
@ronaldlens
Copy link

I have the same issue, Rltk 0.5.17, Macbook Pro. On the laptop screen (retina) the text renders to the bottom left 25% of the window:

Screenshot 2020-01-14 at 22 16 00

Same as @cpv, tweak the size of the window and it's fixed. Same regardless of whether an external monitor is attached or not. After tweaking the size:

Screenshot 2020-01-14 at 22 19 24

@maciejlutostanski
Copy link

Same on windows laptop with 4K screen (build-in). After resize everything looks good.

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

Successfully merging a pull request may close this issue.

4 participants