aboutsummaryrefslogtreecommitdiff
path: root/x.c
diff options
context:
space:
mode:
Diffstat (limited to 'x.c')
-rw-r--r--x.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/x.c b/x.c
index 18d258e..58c2d98 100644
--- a/x.c
+++ b/x.c
@@ -1294,6 +1294,8 @@ xinit(int cols, int rows)
1294 xsel.xtarget = XInternAtom(xw.dpy, "UTF8_STRING", 0); 1294 xsel.xtarget = XInternAtom(xw.dpy, "UTF8_STRING", 0);
1295 if (xsel.xtarget == None) 1295 if (xsel.xtarget == None)
1296 xsel.xtarget = XA_STRING; 1296 xsel.xtarget = XA_STRING;
1297
1298 boxdraw_xinit(xw.dpy, xw.cmap, xw.draw, xw.vis);
1297} 1299}
1298 1300
1299int 1301int
@@ -1340,8 +1342,13 @@ xmakeglyphfontspecs(XftGlyphFontSpec *specs, const Glyph *glyphs, int len, int x
1340 yp = winy + font->ascent; 1342 yp = winy + font->ascent;
1341 } 1343 }
1342 1344
1343 /* Lookup character index with default font. */ 1345 if (mode & ATTR_BOXDRAW) {
1344 glyphidx = XftCharIndex(xw.dpy, font->match, rune); 1346 /* minor shoehorning: boxdraw uses only this ushort */
1347 glyphidx = boxdrawindex(&glyphs[i]);
1348 } else {
1349 /* Lookup character index with default font. */
1350 glyphidx = XftCharIndex(xw.dpy, font->match, rune);
1351 }
1345 if (glyphidx) { 1352 if (glyphidx) {
1346 specs[numspecs].font = font->match; 1353 specs[numspecs].font = font->match;
1347 specs[numspecs].glyph = glyphidx; 1354 specs[numspecs].glyph = glyphidx;
@@ -1545,8 +1552,12 @@ xdrawglyphfontspecs(const XftGlyphFontSpec *specs, Glyph base, int len, int x, i
1545 r.width = width; 1552 r.width = width;
1546 XftDrawSetClipRectangles(xw.draw, winx, winy, &r, 1); 1553 XftDrawSetClipRectangles(xw.draw, winx, winy, &r, 1);
1547 1554
1548 /* Render the glyphs. */ 1555 if (base.mode & ATTR_BOXDRAW) {
1549 XftDrawGlyphFontSpec(xw.draw, fg, specs, len); 1556 drawboxes(winx, winy, width / len, win.ch, fg, bg, specs, len);
1557 } else {
1558 /* Render the glyphs. */
1559 XftDrawGlyphFontSpec(xw.draw, fg, specs, len);
1560 }
1550 1561
1551 /* Render underline and strikethrough. */ 1562 /* Render underline and strikethrough. */
1552 if (base.mode & ATTR_UNDERLINE) { 1563 if (base.mode & ATTR_UNDERLINE) {
@@ -1589,7 +1600,7 @@ xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og)
1589 /* 1600 /*
1590 * Select the right color for the right mode. 1601 * Select the right color for the right mode.
1591 */ 1602 */
1592 g.mode &= ATTR_BOLD|ATTR_ITALIC|ATTR_UNDERLINE|ATTR_STRUCK|ATTR_WIDE; 1603 g.mode &= ATTR_BOLD|ATTR_ITALIC|ATTR_UNDERLINE|ATTR_STRUCK|ATTR_WIDE|ATTR_BOXDRAW;
1593 1604
1594 if (IS_SET(MODE_REVERSE)) { 1605 if (IS_SET(MODE_REVERSE)) {
1595 g.mode |= ATTR_REVERSE; 1606 g.mode |= ATTR_REVERSE;