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

Study page spacing makes RTL languages invisible #6

Open
vancha opened this issue Jul 12, 2024 · 12 comments
Open

Study page spacing makes RTL languages invisible #6

vancha opened this issue Jul 12, 2024 · 12 comments
Assignees
Labels
bug Something isn't working

Comments

@vancha
Copy link

vancha commented Jul 12, 2024

Bug

I tried adding a studyset for the arabic langauge, in an attempt to learn the alphabet. I discovered however that the characters were never shown when you press "study".

Behavior

This screenshot shows what the study page looks like, easily reproducible by just adding an arabic character like ت to any studyset.
screenshot-2024-07-12-08-56-27

Possible solution

The following screenshot shows the same page, but with the spacing (margin and padding) removed from the study page. That makes the character show up in the top right.
screenshot-2024-07-12-08-55-42
This indicates to me that the issue is with the spacing pushing rtl languages out of the visible area.

System

In case it is of any use, my system consists of an HP 87E1 laptop, sporting an i5 1135g7 CPU and an iris XE igpu. It has 8gb of RAM and a 250GB ssd. It runs Pop!_os 22.04 LTS.

@mariinkys
Copy link
Owner

Hi, I'm taking a look at this issue and I'm having a hard time reproducing it as pasting Arabic (or any RTL language) text on the application on my system seems to crash cosmic_text.

Screenshot from 2024-07-12 11-33-26

I'll investigate further into this, and apply a fix ASAP

@mariinkys mariinkys self-assigned this Jul 12, 2024
@mariinkys mariinkys added the bug Something isn't working label Jul 12, 2024
@vancha
Copy link
Author

vancha commented Jul 12, 2024

Hey thanks for looking in to it anyway :) If i can fix it i'll send you the merge request.

@mariinkys
Copy link
Owner

I've opened an issue on the libcosmic repo as I believe this is not intended behavior.

pop-os/libcosmic#534

However I had to add the Flashcard to the database directly as it keeps crashing when pasting RTL languages, how did you add the Arabic flashcard?
I'll try and do more testing on the copy/paste issue for the time being but I do not know if is a me only problem.

@mariinkys
Copy link
Owner

I honestly do not know much about RTL languages but I don't see why It shouldn't center properly on the example I made.

@mariinkys
Copy link
Owner

Testing paste/writing of RTL languages on a widget::text_input always causes the above exception on my machine.

@vancha
Copy link
Author

vancha commented Jul 12, 2024

haha same, i know nothing about it, but i did manage to reduce the problem to this:

widget::button(
    widget::text("نص")
).into(),

This makes the character not show up, but this does:

widget::button(
    widget::text("test")
).into(),

If i remove the surrounding button from the text widget, i don't see any issues, the text shows up either way, just right aligned for arabic and left aligned regularly.

That indicates the issue lies within the toolkit somewhere, so I just asked around in the libcosmic matrix room hoping for an update. They should know where to forward this issue too, if that is even required. :)

@vancha
Copy link
Author

vancha commented Jul 12, 2024

I've opened an issue on the libcosmic repo as I believe this is not intended behavior.

Missed that message, seems you've already added it. Thanks, i hope they manage to solve this! ^^

@mariinkys
Copy link
Owner

@vancha How did you add the flashcard in Arabic, does your application not crash when inputting/pasting text in Arabic in the flashcards creation context page? (sorry for the ping)

@vancha
Copy link
Author

vancha commented Jul 13, 2024

No worries at all, ping me all you want if it helps solve the issue. No I did not experience any crashes. But I'll gladly try an installation on another machine if that helps. I copied the specific character ت from the gnome characters application, and pasted it in where you add the text on the front of the flashcard. No specific sequence or anything to make it work. What might be worth noting is the cosmic itself freezes completely when adding Arabic keyboard layouts: pop-os/cosmic-epoch#347

@mariinkys
Copy link
Owner

No worries at all, ping me all you want if it helps solve the issue. No I did not experience any crashes. But I'll gladly try an installation on another machine if that helps. I copied the specific character ت from the gnome characters application, and pasted it in where you add the text on the front of the flashcard. No specific sequence or anything to make it work. What might be worth noting is the cosmic itself freezes completely when adding Arabic keyboard layouts: pop-os/cosmic-epoch#347

Given the error it throws to me it seems like a cosmic_text issue, however I'll keep a look on this other issue too, thanks. What seems funny to me is that the app does not seem to crash when the app is running as a flatpak but it does happen on my system when cargo running the application. Also the RTL text also seems to behave weirdly when on a textinput as I cannot see what I'm typing (I guess because it's too far to the right).

@mariinkys
Copy link
Owner

I guess we'll have to wait as this is still in pre-alpha state problems like this are expected

@eizemazal
Copy link

I also have an issue with RTL language (Hebrew), but for input controls. The text I type is not visible in the input until I switch to LTR and type some characters, or until I save the card. I tried to use the program under KDE.

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

3 participants