After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 580766 - cursor moves wrong over bidi text
cursor moves wrong over bidi text
Status: RESOLVED OBSOLETE
Product: pango
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: pango-maint
pango-maint
Depends on:
Blocks:
 
 
Reported: 2009-04-29 15:44 UTC by Felipe Heidrich
Modified: 2018-05-22 12:51 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24



Description Felipe Heidrich 2009-04-29 15:44:54 UTC
Please describe the problem:
cursor moves wrong over bidi text including Arabic-Indic numbers
happens for all text input widgets in gtk, including gtk apps such as gedit.
I believe the bug is in pango_layout_move_cursor_visually


Steps to reproduce:
1. Start gedit
2. Set keyboard layout to English
3. Enter text, for example: ABC
4. Set keyboard layout Arabic Digits
5. Enter some Arabic letters
6. Enter some Arabic-Indic numbers
7. Hold arrow left down





Actual results:
cursor circles around the Arabic letters

Expected results:
cursor to move to line start

Does this happen every time?
yes

Other information:
Comment 1 Itay Perl 2009-06-06 12:38:58 UTC
This is a tough one.
The vis2log map for the string "aאב12 " is
0 -> 0
1 -> 5
2 -> 6
3 -> 7
4 -> 3
5 -> 7

(Note that, logically, the Hebrew letters ("א" and then "ב") are placed _before_ the numbers, as described in the report.)

That is, the visual position to the right of "2" and the one to the left of the space map to the same logical position (which is correct). So, the notion that the vis2log relationship is one-to-one is wrong, which means there's no way of finding the visual cursor position given only the logical position. Fixing this would probably require an API change. pango_layout_move_cursor_visually could get a visual position instead of a byte index. If someone can think of a more elegant solution, I'll be glad to hear it.

That's only one problem, the other being that the vis2log map should depend on the direction of the move. For example, if the cursor is moved once to the right from the beginning of the above string, it should be placed (logically) between the "a" and the "א", but when it is moved from between "1" and "2" to the left, the cursor should be placed before the "1", that is, between "ב" and "1". This is the way Mozilla handles it, and also the most intuitive (rather, the least unintuitive) behavior I can imagine for such weird conditions.
Comment 2 GNOME Infrastructure Team 2018-05-22 12:51:29 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/pango/issues/157.