diff options
Diffstat (limited to 'x.c')
-rw-r--r-- | x.c | 21 |
1 files changed, 16 insertions, 5 deletions
@@ -1212,6 +1212,8 @@ xinit(int cols, int rows) | |||
1212 | xsel.xtarget = XInternAtom(xw.dpy, "UTF8_STRING", 0); | 1212 | xsel.xtarget = XInternAtom(xw.dpy, "UTF8_STRING", 0); |
1213 | if (xsel.xtarget == None) | 1213 | if (xsel.xtarget == None) |
1214 | xsel.xtarget = XA_STRING; | 1214 | xsel.xtarget = XA_STRING; |
1215 | |||
1216 | boxdraw_xinit(xw.dpy, xw.cmap, xw.draw, xw.vis); | ||
1215 | } | 1217 | } |
1216 | 1218 | ||
1217 | int | 1219 | int |
@@ -1258,8 +1260,13 @@ xmakeglyphfontspecs(XftGlyphFontSpec *specs, const Glyph *glyphs, int len, int x | |||
1258 | yp = winy + font->ascent + win.cyo; | 1260 | yp = winy + font->ascent + win.cyo; |
1259 | } | 1261 | } |
1260 | 1262 | ||
1261 | /* Lookup character index with default font. */ | 1263 | if (mode & ATTR_BOXDRAW) { |
1262 | glyphidx = XftCharIndex(xw.dpy, font->match, rune); | 1264 | /* minor shoehorning: boxdraw uses only this ushort */ |
1265 | glyphidx = boxdrawindex(&glyphs[i]); | ||
1266 | } else { | ||
1267 | /* Lookup character index with default font. */ | ||
1268 | glyphidx = XftCharIndex(xw.dpy, font->match, rune); | ||
1269 | } | ||
1263 | if (glyphidx) { | 1270 | if (glyphidx) { |
1264 | specs[numspecs].font = font->match; | 1271 | specs[numspecs].font = font->match; |
1265 | specs[numspecs].glyph = glyphidx; | 1272 | specs[numspecs].glyph = glyphidx; |
@@ -1463,8 +1470,12 @@ xdrawglyphfontspecs(const XftGlyphFontSpec *specs, Glyph base, int len, int x, i | |||
1463 | r.width = width; | 1470 | r.width = width; |
1464 | XftDrawSetClipRectangles(xw.draw, winx, winy, &r, 1); | 1471 | XftDrawSetClipRectangles(xw.draw, winx, winy, &r, 1); |
1465 | 1472 | ||
1466 | /* Render the glyphs. */ | 1473 | if (base.mode & ATTR_BOXDRAW) { |
1467 | XftDrawGlyphFontSpec(xw.draw, fg, specs, len); | 1474 | drawboxes(winx, winy, width / len, win.ch, fg, bg, specs, len); |
1475 | } else { | ||
1476 | /* Render the glyphs. */ | ||
1477 | XftDrawGlyphFontSpec(xw.draw, fg, specs, len); | ||
1478 | } | ||
1468 | 1479 | ||
1469 | /* Render underline and strikethrough. */ | 1480 | /* Render underline and strikethrough. */ |
1470 | if (base.mode & ATTR_UNDERLINE) { | 1481 | if (base.mode & ATTR_UNDERLINE) { |
@@ -1507,7 +1518,7 @@ xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og) | |||
1507 | /* | 1518 | /* |
1508 | * Select the right color for the right mode. | 1519 | * Select the right color for the right mode. |
1509 | */ | 1520 | */ |
1510 | g.mode &= ATTR_BOLD|ATTR_ITALIC|ATTR_UNDERLINE|ATTR_STRUCK|ATTR_WIDE; | 1521 | g.mode &= ATTR_BOLD|ATTR_ITALIC|ATTR_UNDERLINE|ATTR_STRUCK|ATTR_WIDE|ATTR_BOXDRAW; |
1511 | 1522 | ||
1512 | if (IS_SET(MODE_REVERSE)) { | 1523 | if (IS_SET(MODE_REVERSE)) { |
1513 | g.mode |= ATTR_REVERSE; | 1524 | g.mode |= ATTR_REVERSE; |