mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-03 04:22:47 -05:00
Support SGR 9 for strikethrough effect on text.
This is mostly easy: it's just like drawing an underline, except that you put it at a different height in the character cell. The only question is _where_ in the character cell. Pango, and Windows GetOutlineTextMetrics, will tell you exactly where the font wants to have it. Following xterm, I fall back to 3/8 of the font's ascent (above the baseline) if either of those is unavailable.
This commit is contained in:
@ -3887,6 +3887,14 @@ static void do_text_internal(
|
||||
y*inst->font_height + uheight + inst->window_border);
|
||||
}
|
||||
|
||||
if (attr & ATTR_STRIKE) {
|
||||
int sheight = inst->fonts[fontid]->strikethrough_y;
|
||||
draw_line(inst, x*inst->font_width+inst->window_border,
|
||||
y*inst->font_height + sheight + inst->window_border,
|
||||
(x+len)*widefactor*inst->font_width-1+inst->window_border,
|
||||
y*inst->font_height + sheight + inst->window_border);
|
||||
}
|
||||
|
||||
if ((lattr & LATTR_MODE) != LATTR_NORM) {
|
||||
draw_stretch_after(inst,
|
||||
x*inst->font_width+inst->window_border,
|
||||
|
Reference in New Issue
Block a user