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.


cheers
aes
From e45994272eb3043ce9a75d4c8dd3d11c8d76472c Mon Sep 17 00:00:00 2001
From: Anders Eurenius <[email protected]>
Date: Sat, 21 Jun 2014 20:32:34 +0200
Subject: [PATCH 3/8] 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.
---
 st.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/st.c b/st.c
index 2083d42..dcbc4cb 100644
--- a/st.c
+++ b/st.c
@@ -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);
 }
-- 
2.0.0

Reply via email to