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 looks vague in macos #480

Open
goflutterjava opened this issue Feb 20, 2022 · 5 comments
Open

Text looks vague in macos #480

goflutterjava opened this issue Feb 20, 2022 · 5 comments

Comments

@goflutterjava
Copy link

Screenshots
image

Desktop (please complete the following information):

  • OS: osx
  • Darwin 192.168.0.102 21.2.0 Darwin Kernel Version 21.2.0: Sun Nov 28 20:28:54 PST 2021; root:xnu-8019.61.5~1/RELEASE_X86_64 x86_64

image

[dependencies]
orbtk = "0.3.1-alpha3"
use orbtk::prelude::{Application, TextBlock, Widget, Window};

fn main() {
    Application::new()
        .window(|ctx| {
            Window::new()
                .title("Dev Tools")
                .position((100.0, 100.0))
                .size(1200.0, 800.0)
                .child(TextBlock::new().text("Dev Tools").build(ctx))
                .build(ctx)
        })
        .run();
}
@rzerres
Copy link
Contributor

rzerres commented Feb 20, 2022

@goflutterjava please can you recheck using OrbTk's development branch? This will be tagged as "0.3.1-alpha4" soon.

@goflutterjava
Copy link
Author

@rzerres When I use the development branch, it raises another error.
image

@rzerres
Copy link
Contributor

rzerres commented Feb 24, 2022

did you go with a

cargo clean
cargo update

it is working for me on x64_86 architecture. Sorry, can't test on OSX.
You may also make use of the bundled feature, as described in the README.md.
I copied you code to orbtk/examples/dev_tools.rs

use orbtk::prelude::*;

fn main() {
    Application::new()
        .window(|ctx| {
            Window::new()
                .title("Dev Tools")
                .position((100.0, 100.0))
                .size(1200.0, 800.0)
                .child(TextBlock::new().text("Dev Tools").build(ctx))
                .build(ctx)
        })
        .run();
}

then called:

cargo run  --features bundled --example dev_tools

@rzerres rzerres added documentation and removed bug labels Feb 24, 2022
@goflutterjava
Copy link
Author

I have run

cargo clean
cargo update

it now raise

cargo run --features bundled main.rs
error: none of the selected packages contains these features: bundled

and this is my toml

[package]
name = "dev-tools-rust-orbtk"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
#orbtk = "0.3.1-alpha4"
orbtk = { git = "https://github.com/redox-os/orbtk.git", branch = "develop"}

Please take a look when you have time, thanks

@rzerres
Copy link
Contributor

rzerres commented Mar 2, 2022

@goflutterjava
Well, i guess the documentation is a bit misleading here.
The feature flags will be available, if you clone the OrbTk repro and create code in this repostitory. Feature flag "--features bundled" will help to download and build the dependency to sdl2. This is not needed, if you already have a target bound sdl2 library (in your case the OSX build).

If you create your own crate, you are just including the dependency to orbtk. Thus, it will build these crates with the default flags. And here OrbTk will not call the "bundled" feature as a default.

To get that strait

  • your dev-tools-rust-orbtk toml is all fine

  • inside its crate root just call

    cargo run
    

    This will

    • download all defined dependencies

    in this case OrbTK develop branch, ala orbtk-0.3.1.0alpha5, which in turn will require all its dependencies ...

    • complile src/main.rs in debug mode
      since this is the default target and the default source when compiling rust code.

    • will run the compiled and linked executable
      which will be called dev-tools-rust-orbtk, as defined in the toml file.

I just copied the minimal.rs code from orbtk/orbtk/example as src/main.rs to your crate (your code is fine as well). And as expected, i get the rendered window. I can't crosscompile for OSX, sorry.

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

No branches or pull requests

2 participants