[hackers] [st] Render struck-out attribute || Anders Eurenius

From: <git_AT_suckless.org>
Date: Fri, 27 Jun 2014 14:07:30 +0200

commit 1fc4afd1e6609732178369c7f17c917204aad4cc
Author: Anders Eurenius <aes_AT_spotify.com>
Date: Sat Jun 21 20:32:34 2014 +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 <k0ga_AT_shike2.com>

diff --git a/st.c b/st.c
index a69cc9e..3aa8539 100644
--- a/st.c
+++ b/st.c
_AT_@ -3383,6 +3383,11 @@ xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) {
                                 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);
 }
Received on Fri Jun 27 2014 - 14:07:30 CEST

This archive was generated by hypermail 2.3.0 : Fri Jun 27 2014 - 14:12:09 CEST