GNOME Bugzilla – Bug 124514
Backspace removes base-character with combining-character
Last modified: 2004-12-22 21:47:04 UTC
- Type a Persian/Arabic text in any gnome app, like gedit. sample: "سلام" - Put a combining Persian/Arabic character at the end of it. like: "ِ" - Now press [BackSpace] key; The combining character, and it's previus character will be deleted. The sample will be: "سلا" then. In Persian/Arabic writing and typesetting, [BackSpace] only removes the combining character, not anything else. It's very important for Persian/Arabic input.
*** This bug has been marked as a duplicate of 119891 ***
The patch below make pango not to delete arabic marks with their base. It just sets log_attr.is_cursor_position TRUE, for arabic marks.
Created attachment 23598 [details] [review] Not to delete Arabic marks with their base
Pango-1.3 has backspace_deletes_character, in PangoLogAttr the correct change is to make GtkEntry and GtkTextView respect that (And note this bug is resolved as a duplicate of a different bug)
Dear Owen, For arabic marks the is_cursor_position have to be TRUE. Because, when an arabic mark character is entered, they want the cursor to trace the marks too, not only the bases. In other words, (to complete this bug,) now pango-1.3 1- doesn't place the cursor for marks and place the cursor just for bases and, 2- it deletes marks with their bases. So, I think making is_cursor_position TRUE is right for arabic, and when is_cursor_position is made true the backspace_deletes_character is made true, implicitly. Best Regards
Soheil, If you read Owen's comment again, it's a bug in Gtk now that does not support (honor) backspace_deletes_character. And no, I'm not sure if Arabic marks should have cursor_position, but yes, that's the way the other OS handles it. Roozbeh?
Behdad, By my comment, implicitly, I mean that pango should handle that. So, I complete my comment: Pango has functions, providing cursor position of the given character index ( (.*)index_to_(x|pos) ) and some of them are using the log_attr values ( e.g. is_cursor_position ) to get the position of the given character index, so I think that Pango should handle such this thing not GTK. Owen? Best Regards
For most languages, you really don't want a cursor position before marks / within clusters. So the backspace_deletes_character logical attribute is needed. And backspace_deletes_character is implemented in Pango, but its the GTK+ code that needs to pay attention to it. I don't know what the correct behavior is for Arabic where the marks indicate vowels rather than modifying the base character. My concerns about putting a cursor position between the vowel mark and base character are the following: - Pango's handling of cursor positioning is very simple - the cursor just linearly advances through the cluster for each cursor position within it. I'm not sure it will be clear to the user what is going on without a fancier display of the cursor. - If the extra cursor position is there, the user is given many more ways of creating invalid combinations of mark without base character, and that will increase user confusion. Let's get the backspace_deletes_character working for GTK+-2.3.3, see how Arabic-script users like it, and then consider whether we actually want to add extra cursor positions.
Setting is_cursor_position is necessary for dotted-circle representation of combining-marks. Suppose you've a Unicode string such as: logicalOrder = [U+0627 U+064B U+064C] according to dotted-circle rule of Unicode standard this string should be displayed visually as (G+XXXX = glyph of U+XXXX): visualOrder = [G+06CC G+064C G+0627 G+064B] Pango compute Logical Attributes for logicalOrder and there is no way other than setting the is_cursor_position of U+064C to indicate there is a cursor stop before the G+06CC
Mehran, Seems like a good thing not to be able to stop before the implicit dotted circle :).