Pango delete/backspace best practices
- Date: Sat, 22 Jul 2017 12:45:27 +0100
- From: Jeffrey Sheen <jeffrey.sheen00@xxxxxxxxxxxxxxxxxxxxx>
- Subject: Pango delete/backspace best practices
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?
_______________________________________________ gtk-list mailing list gtk-list@xxxxxxxxx https://mail.gnome.org/mailman/listinfo/gtk-list
- Prev by Date: Re: GTK's interfaces and language bindings
- Next by Date: Dialogue Wholly Insensitive on Losing Keyboard Focus.
- Previous by thread: Having trouble with cursors
- Next by thread: Dialogue Wholly Insensitive on Losing Keyboard Focus.