Created attachment 82512 [details]
When I select text in italics or containing ligatures, the whole of the glyph is drawn in the selection glyph colour, even when this falls outside the selection box. It should be fairly easy to clip the text selection text paint to the selection box.
See attachment to bug 7002 for a PDF exhibiting this issue.
Thanks for the patch. It doesn't apply to current git master, so I've adapted it and pushed.