GNOME Bugzilla – Bug 114483
Add deletion boundaries to PangoLogAttr
Last modified: 2004-12-22 21:47:04 UTC
There should be a bit in PangoLogAttr that indicates that when deleting from the next grapheme boundary, that deletion should stop at this position. Deleting whole graphemes is typically too large. The hard part of this is calculation of the positions. (Worth checking for existing practice in ICU, etc.) See bug 107561 for details.
Rather than a separate boundary bit, I think better is to have bit that you set on the grapheme position. guint backspace_deletes_character : 1; The reason for this is that you want to delete one *decomposed* character, even if the text is using a pre-composed form. (Hangul being an example where this is likely to come up.)
*** Bug 100809 has been marked as a duplicate of this bug. ***
It seems to me that this is a one line change, so we can commit it at earliest convenience, right? No need to change the implementation for 1.4, imho.
I don't think it's interesting to add the attribute without adding the implementation. If the implementation is hard, we aren't going to get to it before 1.6 if it doesn't make 1.4.0. And this is actually a fairly serious problem for some languages. Adding the attribute and a trivial implementation (say, backspace_deletes_character is set unless the base character for the preceding grapheme is a Latin or Cyrillic character) shouldn't be that much work.
My thought is that if we add the attribute for 1.4, then people will have the opportunity to implement language engines with script_break during the active life of 1.4, potentially getting it into one of the point releases. Improving pango_default_break could be done for a point release, too. I don't mean to punt prematurely, though. Duly noted that something simple can be done for the default implementation.
Created attachment 19204 [details] [review] patch (turns on backspace_deletes_character except for latin, cyrillic and greek)
Looks good, couple of small comments: * ! LATIN (wc) would be better as !LATIN (wc) * I'd really try to phrase: + /* if not set, backspace deletes a grapheme cluster */ as a positive, not a negative. Maybe: /* if set, backspace deletes one character rather than * the entire grapheme cluster */ * Despite no other fields of PangoLogAttr being documented in the docs, I would like to see docs added for new additions, especially since the usage of this one is not that clear. * Before closing this bug, we need to open another for GTK+ to add support for this to GtkEntry and GtkTextView.
Created attachment 19218 [details] [review] patch as I'm about to apply it
2003-08-14 Noah Levitt <nlevitt@columbia.edu> * docs/tmpl/main.sgml: * pango/break.c: * pango/pango-break.h: Add backspace_deletes_character to PangoLogAttr. (#114483) P.S. Feel free to change the description in docs/tmpl/main.sgml. I tried to make it clear, but I'm sure there's room for improvement.