diff options
author | Federico Igne <git@federicoigne.com> | 2020-05-23 11:29:02 +0100 |
---|---|---|
committer | Federico Igne <git@federicoigne.com> | 2020-05-23 11:29:02 +0100 |
commit | 81df9b428bd0330af98db9c69ffe69b0441e00fd (patch) | |
tree | 58773d60020d006a841f18b80578d9e763e839e9 /x.c | |
parent | dd31d0207ba2acebfb65400e916a624a57c638a4 (diff) | |
download | st-81df9b428bd0330af98db9c69ffe69b0441e00fd.tar.gz st-81df9b428bd0330af98db9c69ffe69b0441e00fd.zip |
Apply BoxDraw patch
Homepage link: https://st.suckless.org/patches/boxdraw/
Patch link: https://st.suckless.org/patches/boxdraw/st-boxdraw_v2-0.8.3.diff
Additional info: patch applied manually.
Diffstat (limited to 'x.c')
-rw-r--r-- | x.c | 21 |
1 files changed, 16 insertions, 5 deletions
@@ -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 | ||
1299 | int | 1301 | int |
@@ -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; |