-
Notifications
You must be signed in to change notification settings - Fork 576
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
The button component cannot be displayed in Chinese #5456
Comments
Thanks for filling an issue. Looks like a font problem. |
I had the same problem, windows and winit renderer. |
I think I can reproduce this. Here's a simpler test case: import { Slider } from "std-widgets.slint";
export component Demo {
width: 200px;
height: 200px;
Text {
x: 50px;
y: 50px;
text: "Hello";
height: sl.value * 1px;
}
sl := Slider {
width: 100%;
y: parent.height - self.height;
value: 10;
minimum: 8;
maximum: 64;
}
} Observe how the text of the button appears and disappears depending on the height. When a In your case, as it happens, the height is insufficient for the font selected to display the Chinese text - I suspect the ascent/descent is just above the 24px you specify. I recommend placing widgets into layouts and letting them resize based on their minimum size, instead of hard-coding a specific height. That way the application also works well when users have bigger font sizes configured on their system, for example, for improved readability. |
Duplicate of #2029 |
After setting the height of the button component, the preview display is normal, but the Chinese language cannot be displayed after publication
Button { text: "复制"; height: 24px; }
The text was updated successfully, but these errors were encountered: