-
Notifications
You must be signed in to change notification settings - Fork 570
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
Can't render arabic text in Labels, Buttons and other widgets #1819
Comments
I would guess that piet has some problems with right-to-left text. diff --git a/druid/src/widget/label.rs b/druid/src/widget/label.rs
index cd3cb661..e717d07c 100644
--- a/druid/src/widget/label.rs
+++ b/druid/src/widget/label.rs
@@ -604,11 +604,13 @@ impl<T: TextStorage> Widget<T> for RawLabel<T> {
self.layout.rebuild_if_needed(ctx.text(), env);
let text_metrics = self.layout.layout_metrics();
+ println!("{:?}", text_metrics);
ctx.set_baseline_offset(text_metrics.size.height - text_metrics.first_baseline);
let size = bc.constrain(Size::new(
text_metrics.size.width + 2. * LABEL_X_PADDING,
text_metrics.size.height,
));
+ println!("{:?}", size);
trace!("Computed size: {}", size);
size
} results in
A width of zero seems... insufficient. Edit: Possibly related: linebender/piet#432 |
We are definitely not officially supporting BiDi yet, but hope to in a future cycle. |
This is also going to be highly backend specific. The situation may be worse on linux than on macos or windows. That said, RTL text (but not BiDi) is supported in piet, so it's possible this is just an error in the integration? @nomad-rst can you confirm that you're on linux? |
I should have mentioned, I'm not on Linux, the issue I posted above is me using windows 10 x64 |
@nomad-rst when you run a druid app, druid auto-selects an appropriate 'backend' based on your platform; e.g. on windows it uses the windows backend. :) |
@cmyr Please also tag this with shell/gtk and shell/x11 as per #1819 (comment) (although this might also be a different issue, it still looks similar enough to me....) |
Hmm interesting. This does appear to be working on macOS, so I'm not sure if these will end up being exactly the same bugs or not. |
basically if I try to do this :
the button and the label are in the form but the text is empty
also I tried using the arabic_reshaper crate (which works in terminal and in image proc to render arabic text correctly) like this
but the problem is the same
The text was updated successfully, but these errors were encountered: