Re: Pango delete/backspace best practices



Or, more likely, you sent the email to the wrong list. You probably
want to talk to the developers of text editors based on GtkTextView
and Pango.

Additionally, you may want to look at GtkTextView itself.

Ciao,
 Emmanuele.


On 1 September 2017 at 12:14, Jeffrey Sheen
<jeffrey sheen00 alumni imperial ac uk> wrote:
Dear list,

As there has not been a response to my query about Unicode deletion-key
interrupts, one of the following must be true:

My question does not make sense, as I have made an incorrect assumption
No-one on the list has written code for a text editor widget
No-one wishes to share their experience writing code for a text editor
widget

The first reason is most likely, but I would appreciate a brief explanation.

Deletion-key interrupts are a fundamental use-case of creating an
application with interactive text, so I think this is an important talking
point.

Jeff.

On 22 July 2017 at 12:45, Jeffrey Sheen
<jeffrey sheen00 alumni imperial ac uk> wrote:

Dear list,

I would like to leverage your experience with the Pango API.

I am currently using "pango_layout_move_cursor_visually" to handle
arrow-key presses. This establishes the byte index that the cursor should be
moved to, visually skipping whole grapheme clusters.

However, I understand that there are more states are required when
handling the delete and backspace keys, depending on the text's language.

i.e. it is possible to press a deletion key, and the grapheme cluster be
altered, but not reduce the number of grapheme clusters in the string.

Reading the Pango API documentation, this aspect appears to be represented
with the "PangoLogAttr.backspace_deletes_character" member variable.

However, unlike "pango_layout_move_cursor_visually", "pango_get_log_attrs"
operates below the level of a PangoLayout object, requiring a PangoLanguage*
to be passed.

Must I manually store the language that a block of text is written in and
convert this to a PangoLanguage object?

What is the best practice when handling a delete/backspace key press?

Cheers,

Jeff.



_______________________________________________
gtk-list mailing list
gtk-list gnome org
https://mail.gnome.org/mailman/listinfo/gtk-list




-- 
https://www.bassi.io
[@] ebassi [@gmail.com]


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]