iced
iced copied to clipboard
Support for non-Latin languages
Is there an existing issue for this?
- [X] I have searched the existing issues.
Is this issue related to iced?
- [X] My hardware is compatible and my graphics drivers are up-to-date.
What happened?
Running the tour
package, and typing Arabic text on the Text input
page, displays squared interrogation point characters.
$ cargo run --package tour
What is the expected behavior?
Arabic text should be displayed correctly.
Version
master
Operative System
Linux
Do you have any log output?
No response
I believe with the default_system_font
feature enabled, this should at least be able to find a font with the appropriate characters?
Though Arabic text still won't be right without RTL support (https://github.com/iced-rs/iced/issues/250) and text shaping (https://github.com/iced-rs/iced/issues/33).
I added default_system_font
to the iced features in iced/examples/tour/Cargo.toml
:
[dependencies]
iced = { path = "../..", features = ["image", "debug", "default_system_font"] }
env_logger = "0.8"
and then run:
$ cargo run --package tour
But no Arabic characters are displayed properly.
I added default_system_font to the iced features in iced/examples/tour/Cargo.toml:
![Screen Shot 2022-10-08 at 9 59 36 PM](https://user-images.githubusercontent.com/169691/194723385-705c0a9e-41b7-4e6d-8862-5c2588ddffc5.png)
i think that your problem is lacking a font that contains the relevant glyphs.
but RTL is still not supported yet
i think that your problem is lacking a font that contains the relevant glyphs.
I disagree, as I routinely write Arabic text in other applications (libreoffice, kate, etc.) and I don't have any font issues.
@koutheir Check this out! https://github.com/pop-os/libcosmic/pull/12 Please try out Arabic in the text example and help locate bugs in the rendering.
i think that your problem is lacking a font that contains the relevant glyphs.
I think Iced isn't implementing fallback font behavior, which is normally used to find a font for a different writing system. So that's why it doesn't find a font with the right gylphs.
Luckily this (as well as text shaping and RTL) is being prototyped in libcosmic as mentioned, and hopefully will be integrated into Iced soon.
Check this out! https://github.com/pop-os/libcosmic/pull/12 Please try out Arabic in the text example and help locate bugs in the rendering.
Running the following command panics:
$ cargo run --package cosmic
<...>
Running `target/debug/cosmic`
icon 'go-previous-symbolic' size 24 not found
icon 'window-minimize-symbolic' size 16 not found
icon 'window-maximize-symbolic' size 16 not found
icon 'window-close-symbolic' size 16 not found
icon 'network-wireless' size 20 not found
icon 'preferences-desktop' size 20 not found
icon 'system-software-update' size 20 not found
thread 'main' panicked at 'Downcast on stateless state', /home/koutheir/.cargo/git/checkouts/iced-14fbad96f5d3e3c7/7461b82/native/src/widget/tree.rs:172:28
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Running the following command works:
$ cargo run --package text
The Arabic letters are rendered correctly, and selecting them with the mouse and moving between the characters works as I expect.
However, using the Right
and Left
keyboard keys works logically, instead of visually, i.e., the Left
key moves to the right, and vice versa, and that feels weird. I don't know if that's intended or it is an issue.