Render struck-out attribute
Implement crossed-out text with an XftDrawRect call, similar to how underline is implemented. The line is drawn at 2/3 of the font ascent, which seems to work nicely in practice. Signed-off-by: Roberto E. Vargas Caballero <k0ga@shike2.com>
This commit is contained in:
parent
21bd4f4f9d
commit
1fc4afd1e6
5
st.c
5
st.c
@ -3383,6 +3383,11 @@ xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) {
|
|||||||
width, 1);
|
width, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(base.mode & ATTR_STRUCK) {
|
||||||
|
XftDrawRect(xw.draw, fg, winx, winy + 2 * font->ascent / 3,
|
||||||
|
width, 1);
|
||||||
|
}
|
||||||
|
|
||||||
/* Reset clip to none. */
|
/* Reset clip to none. */
|
||||||
XftDrawSetClip(xw.draw, 0);
|
XftDrawSetClip(xw.draw, 0);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user