Line width fixes/cleanups
@egmontkob
Submitted by Egmont Koblinger Link to original bug (#789534)
Description
Some more or less related issues:
-
Underline (escape sequence) and strikethrough should use pango_font_metrics_get_{underline,strikethrough}_{position,thickness} to get the desired position and thickness, rather than guessing from the height, ascent and descent.
-
Regex/hyperlink underlines, and the outlined cursor are 1px wide. This isn't wise, especially with hidpi in mind. I guess 1px could remain as a safety cap, but the default should always be a value that scales with the font (e.g. the same as escape sequence underline width). (Also, check if there's anything else that's currently 1px regardless of the font size [apart from padding]. Furthermore, revise regex_underline_position too.)
-
I think VTE_LINE_WIDTH (which is hardly used anyway) should be deprecated/removed, or at least renamed to VTE_LINE_MIN_WIDTH and made sure that this is its only role.
-
I hate the interface of _vte_draw_draw_line(), it draws a line by taking 5 dimension values: the 4 coords plus a minimum width. Its usage is hence ambiguous: shall the actual width go to these 4 coords, or the 5th such parameter? The minimum width shouldn't be enforced by this method, but taken into account whenever we compute the desired width for whatever purpose. Plus, its interface and implementation has a counterintuitive off-by-one and as such, when the method is used, a similar (opposite) off-by-one is also required. I can't see the point of having this method, rather than drawing a filled rectangle using a simpler and better API.
-
Similarly, I'd revise if we need _vte_draw_draw_rectangle() with its hardcoded VTE_LINE_WIDTH (only used for the outlined cursor), I guess we'd better draw it manually using 4 lines and ditch this method too. Or at least have the exact width injected as a parameter.
Version: git master