tRender struck-out attribute - st - [fork] customized build of st, the simple t… | |
git clone git://src.adamsgaard.dk/st | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 1fc4afd1e6609732178369c7f17c917204aad4cc | |
parent 21bd4f4f9dce4dd19f218965e5a223c93a5a0fec | |
Author: Anders Eurenius <[email protected]> | |
Date: Sat, 21 Jun 2014 20:32:34 +0200 | |
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 <[email protected]> | |
Diffstat: | |
M st.c | 5 +++++ | |
1 file changed, 5 insertions(+), 0 deletions(-) | |
--- | |
diff --git a/st.c b/st.c | |
t@@ -3383,6 +3383,11 @@ xdraws(char *s, Glyph base, int x, int y, int charlen, … | |
width, 1); | |
} | |
+ if(base.mode & ATTR_STRUCK) { | |
+ XftDrawRect(xw.draw, fg, winx, winy + 2 * font->ascent / 3, | |
+ width, 1); | |
+ } | |
+ | |
/* Reset clip to none. */ | |
XftDrawSetClip(xw.draw, 0); | |
} |