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

Chinese characters don't display correctly in some condition. #5479

Open
thinjade opened this issue Jun 25, 2024 · 1 comment
Open

Chinese characters don't display correctly in some condition. #5479

thinjade opened this issue Jun 25, 2024 · 1 comment
Labels
a:renderer-femtovg Femtovg renderer (mS) a:text Text rendering, fonts, Text input (mS,bF) bug Something isn't working

Comments

@thinjade
Copy link

Text widgets seem not to display correctly with Chinese character, here are some examples:

  1. English letter and Chinese character joined with \n, the Chinese character should be displayed as tofu.
slint::slint! {
    export component HelloWorld {
	width: 200px;
    height: 100px;
        Text {
            text: "hello,world.\n你好世界";
        }
    }
}
fn main() {
    HelloWorld::new().unwrap().run().unwrap();
}

1

2.All the Chinese character joint with \n, the character just in front of \n was missing.

slint::slint! {
    export component HelloWorld {
	width: 200px;
    height: 100px;
        Text {
            text: "你好\n世界";
        }
    }
}
fn main() {
    HelloWorld::new().unwrap().run().unwrap();
}

2

3.If add a space before \n, it could display well.

slint::slint! {
    export component HelloWorld {
	width: 200px;
    height: 100px;
        Text {
            text: "你好 \n世界";   // here is a  space in front of \n
        }
    }
}
fn main() {
    HelloWorld::new().unwrap().run().unwrap();
}

3

Environments is msys x86_64 with Windows 10, default backend.

@tronical tronical added bug Something isn't working a:text Text rendering, fonts, Text input (mS,bF) a:renderer-femtovg Femtovg renderer (mS) labels Jun 26, 2024
@tronical
Copy link
Member

Thanks for the bug report. Looks like a series of bugs indeed. Could you enabling the Skia renderer and see if that works better for you? See https://releases.slint.dev/1.6.0/docs/slint/src/advanced/backend_winit and you might have to enable the renderer-skia feature on the slint crate (or enable SLINT_FEATURE_RENDERER_SKIA=ON if you're using CMake).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:renderer-femtovg Femtovg renderer (mS) a:text Text rendering, fonts, Text input (mS,bF) bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants