**Not for 5.0 - please hold this for the release after 5.0.**
#### Brief overview of PR changes/additions
- `TTextEdit` lays text out in cells of `QFontMetrics::height()`, a
typographic measure rather than the glyph ink box, so at many font sizes
the ink of `_ g j p q y $ @ ( )` reaches a pixel past the bottom of its
cell. On Bitstream Vera Sans Mono at 14pt the underscore is a 1px bar
sitting entirely below the cell, so it disappears completely.
- The screen is now rendered with each line's cell backgrounds painted
before the previous line's glyphs, the screen pixmap has a spare row for
the bottom line's overflow, and partial repaints and scroll blits put
back the overflow they would otherwise erase.
- With backgrounds no longer able to clobber overflow, the narrowed
background-fill condition from #9288 goes back to what #8887 intended.
Measured with an offscreen A/B of the same scene: 15.0-15.2ms per frame
against 16.5-16.9ms before, on both the full-repaint and the scrolling
path (ASan build, so treat the absolute numbers as relative only).
#### Motivation for adding to Mudlet
#9288 tried to fix this by letting the overflow pixel survive into the
next line's cell, but four separate things still erase it: the next
line's background fill whenever the colour differs (coloured text,
selection, search highlight, caret, background image, alpha), the
partial-repaint clear, the bottom edge of the screen pixmap, and the
scroll blit. That is why the reporter sees different `print`-style
functions behave differently at the same size.
#### Other info (issues closed, discussion etc)
Fixes#9719. Completes #9070, which #9288 only partly addressed.
`GlyphOverflowTest` renders a real console offscreen across two bundled
fonts and 22 font sizes and compares the underscore's ink against the
same glyph drawn on its own. All five of its cases fail on `development`
and pass here: the line below carrying a default, coloured, bright or
selected background; the bottom visible line; a partial repaint; a
scroll-back; and a miniconsole.
Copy-as-image is fixed too: its pixmap is exactly one cell per selected
line, so the bottom line's ink was cut off every time.
Known limitations, both unchanged from before this PR:
- The topmost visible line's ink can overflow above the pixmap and be
clipped. Fixing it would mean shifting the whole screen-pixmap
coordinate system.
- When a pane's height is an exact multiple of the line height there is
no leftover strip below the last line, so the bottom line's overflow has
no pixel to live in. Measured at roughly 1 pane height in every 22 for
both the main console and the split-screen lower pane. The only fix is
to drop a row when there is no slack, and because rows are quantised
that costs a whole line of text plus a blank line-height strip at the
same ~4.5% of heights, which is a worse trade than the pixel it buys.
Resizing the pane by one pixel restores it.
Test case: `ctest -R GlyphOverflowTest`, or set Bitstream Vera Sans Mono
at 14pt and `cecho("<yellow>plain _underscore_\n<white:blue>coloured
line\n")`.
Assisted-by: Claude:claude-opus-5
https://github.com/user-attachments/assets/cbda2288-1e3e-4f24-9763-7275d2f09134