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

Support for non-Latin languages #1454

Open
2 tasks done
koutheir opened this issue Oct 4, 2022 · 9 comments
Open
2 tasks done

Support for non-Latin languages #1454

koutheir opened this issue Oct 4, 2022 · 9 comments
Labels
bug Something isn't working

Comments

@koutheir
Copy link

koutheir commented Oct 4, 2022

Is there an existing issue for this?

  • I have searched the existing issues.

Is this issue related to iced?

  • 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

Screenshot

What is the expected behavior?

Arabic text should be displayed correctly.

Version

master

Operative System

Linux

Do you have any log output?

No response

@koutheir koutheir added the bug Something isn't working label Oct 4, 2022
@ids1024
Copy link
Contributor

ids1024 commented Oct 4, 2022

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 (#250) and text shaping (#33).

@koutheir
Copy link
Author

koutheir commented Oct 4, 2022

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.

Screenshot

@adals
Copy link

adals commented Oct 8, 2022

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

i think that your problem is lacking a font that contains the relevant glyphs.

but RTL is still not supported yet

@koutheir
Copy link
Author

koutheir commented Oct 8, 2022

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.

@mmstick
Copy link
Contributor

mmstick commented Oct 9, 2022

@koutheir Check this out! pop-os/libcosmic#12 Please try out Arabic in the text example and help locate bugs in the rendering.

@ids1024
Copy link
Contributor

ids1024 commented Oct 9, 2022

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.

@koutheir
Copy link
Author

koutheir commented Oct 9, 2022

Check this out! pop-os/libcosmic#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.

@lost22git
Copy link

same profblem, any update?

@13r0ck
Copy link
Member

13r0ck commented Mar 12, 2023

@lost22git yep! See the advanced-text branch. https://github.com/iced-rs/iced/tree/advanced-text

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants