Cursor height vs. line height
Submitted by Owen Taylor
Link to original bug (#487677)
Description
Currently, the Pango behavior is to make the height of a cursor the same as the height of the line, no matter what. This feels better when you have a couple of similar sized fonts on a line ... say, a fixed-width and proportional width font. But it works very badly in cases like embedded widgets/images in GtkTextView.
+---------------+
| Image | |<---- gigantic weird cursor
| | |
| | |
+---------------+ Some text|
What the patch I'm attaching here does is:
- Use the line height if it's less than twice the run height
- Otherwise, use the run height
I've made an attempt to handle split cursors correctly, though I haven't done any actual testing of that.
There is one major inefficiency in the patch ... it computes the run height from the run extents, which requires walking over all characters in the run. It would likely be better to use the font metrics for the run to get the height. (I think for all supported backends, logical height of a character are derived exactly from the font ascent/descent.)
After some experimenting, this patch really didn't do the trick for what I wanted .... since you still have a funky cursor at the position right after the Image. Getting large images to work well in the text view is likely going to require text view hacking and/or evil hacks. But it might still be a worthwhile improvement, so I'm submitting it here.
Version: 1.14.x