Browse Source

add readme, return and update boxdraw, improve latency

Von Random 2 weeks ago
parent
commit
b63af87e4c
4 changed files with 181 additions and 76 deletions
  1. 12
    0
      README.md
  2. 14
    2
      config.h
  3. 1
    1
      makest
  4. 154
    73
      st-boxdraw_v2-0.2.8.patch

+ 12
- 0
README.md View File

@@ -0,0 +1,12 @@
1
+st-patches
2
+==========
3
+
4
+A personal set of st configuration and patches because why the fuck not.
5
+
6
+Includes:
7
+* [st-boxdraw_v2-0.8.2.diff](https://st.suckless.org/patches/boxdraw/) - draw beautiful pseudo graphic lines instead of whatever your font provides
8
+* st-bright-bold-text.patch - make non-colored bold text brigh
9
+* st-disable-bold-italic-fonts.patch - actually disable bold, italic or bold italic font styles
10
+* st-disable-intensity-styles.patch - disable so called "intensity styles", do not make colored bold text bright
11
+* makest - a simple script to apply all the patches and build st
12
+* config.h - my config

+ 14
- 2
config.h View File

@@ -46,8 +46,8 @@ static unsigned int tripleclicktimeout = 600;
46 46
 int allowaltscreen = 1;
47 47
 
48 48
 /* frames per second st should at maximum draw to the screen */
49
-static unsigned int xfps = 60;
50
-static unsigned int actionfps = 30;
49
+static unsigned int xfps = 300;
50
+static unsigned int actionfps = 150;
51 51
 
52 52
 /*
53 53
  * blinking timeout (set to 0 to disable blinking) for the terminal blinking
@@ -60,6 +60,18 @@ static unsigned int blinktimeout = 0;
60 60
  */
61 61
 static unsigned int cursorthickness = 1;
62 62
 
63
+/*
64
+ * 1: render most of the lines/blocks characters without using the font for
65
+ *    perfect alignment between cells (U2500 - U259F except dashes/diagonals).
66
+ *    Bold affects lines thickness if boxdraw_bold is not 0. Italic is ignored.
67
+ * 0: disable (render all U25XX glyphs normally from the font).
68
+ */
69
+const int boxdraw = 1;
70
+const int boxdraw_bold = 0;
71
+
72
+/* braille (U28XX):  1: render as adjacent "pixels",  0: use font */
73
+const int boxdraw_braille = 0;
74
+
63 75
 /*
64 76
  * bell volume. It must be a value between -100 and 100. Use 0 for disabling
65 77
  * it

+ 1
- 1
makest View File

@@ -4,7 +4,7 @@ ST_REPO=https://git.suckless.org/st
4 4
 ST_SRC=$PWD/st
5 5
 ST_CFG=$PWD/config.h
6 6
 PATCHLIST=(
7
-    #st-boxdraw.patch
7
+    st-boxdraw_v2-0.8.2.patch
8 8
     st-bright-bold-text.patch
9 9
     st-disable-bold-italic-fonts.patch
10 10
     st-disable-intensity-styles.patch

st-boxdraw.patch → st-boxdraw_v2-0.2.8.patch View File

@@ -1,35 +1,37 @@
1
-From 1630b7016d26c266d004f38ecfef2c4b708aa9a6 Mon Sep 17 00:00:00 2001
1
+From 318ae7fe1bd614cb937c8f43d855a1c2e8e93fd4 Mon Sep 17 00:00:00 2001
2 2
 From: "Avi Halachmi (:avih)" <avihpit@yahoo.com>
3
-Date: Fri, 26 Oct 2018 13:11:20 +0300
4
-Subject: [PATCH] boxdraw: custom-draw U+25XX lines/blocks to align seamlessly
3
+Date: Wed, 26 Dec 2018 14:51:45 +0200
4
+Subject: [PATCH] boxdraw_v2: custom render lines/blocks/braille for perfect
5
+ alignment
5 6
 
6 7
 It seems impossible to ensure that blocks and line drawing glyphs
7 8
 align without visible gaps for all combinations of arbitrary font,
8 9
 size and width/height scale factor.
9 10
 
10
-This commit adds an option to custom-draw (without using the font)
11
-most of the lines/blocks codepoints such that they're rendered
12
-identically (per size) and align perfectly regardless of font, size
13
-or chscale/cwscale configuration values.
11
+This commit adds options to render most of the lines/blocks and
12
+braille codepoints without using the font such that they align
13
+perfectly regardless of font, size or other configuration values.
14 14
 
15
-138 shapes are supported (U+2500 - U+259F except dashes, diagonals
16
-and shades), composited as 16-bit values at boxdraw_data.h .
15
+Supported codepoints are U+2500 - U+259F except dashes/diagonals,
16
+and U28XX.
17 17
 
18
-See links and references at boxdraw_data.h
18
+The lines/blocks data is stored as 16-bit values at boxdraw_data.h
19
+
20
+boxdraw/braille are independent, disabled by default at config[.def].h
19 21
 ---
20 22
  Makefile       |   3 +-
21
- boxdraw.c      | 141 ++++++++++++++++++++++++++++++++++
22
- boxdraw_data.h | 202 +++++++++++++++++++++++++++++++++++++++++++++++++
23
- config.def.h   |   8 ++
23
+ boxdraw.c      | 194 ++++++++++++++++++++++++++++++++++++++++++++
24
+ boxdraw_data.h | 214 +++++++++++++++++++++++++++++++++++++++++++++++++
25
+ config.def.h   |  12 +++
24 26
  st.c           |   3 +
25
- st.h           |   9 +++
26
- x.c            |  19 +++--
27
- 7 files changed, 379 insertions(+), 6 deletions(-)
27
+ st.h           |  10 +++
28
+ x.c            |  21 +++--
29
+ 7 files changed, 451 insertions(+), 6 deletions(-)
28 30
  create mode 100644 boxdraw.c
29 31
  create mode 100644 boxdraw_data.h
30 32
 
31 33
 diff --git a/Makefile b/Makefile
32
-index 0b3cecd..8d3af33 100644
34
+index 470ac86..6dfa212 100644
33 35
 --- a/Makefile
34 36
 +++ b/Makefile
35 37
 @@ -4,7 +4,7 @@
@@ -51,72 +53,96 @@ index 0b3cecd..8d3af33 100644
51 53
  
52 54
 diff --git a/boxdraw.c b/boxdraw.c
53 55
 new file mode 100644
54
-index 0000000..357250f
56
+index 0000000..28a92d0
55 57
 --- /dev/null
56 58
 +++ b/boxdraw.c
57
-@@ -0,0 +1,141 @@
59
+@@ -0,0 +1,194 @@
60
++/*
61
++ * Copyright 2018 Avi Halachmi (:avih) avihpit@yahoo.com https://github.com/avih
62
++ * MIT/X Consortium License
63
++ */
64
++
58 65
 +#include <X11/Xft/Xft.h>
59 66
 +#include "st.h"
60 67
 +#include "boxdraw_data.h"
61 68
 +
62
-+static void drawbox(XftDraw *, int, int, int, int, XftColor *, ushort);
63
-+static void drawboxlines(XftDraw *, int, int, int, int, XftColor *, ushort);
69
++/* Rounded non-negative integers division of n / d  */
70
++#define DIV(n, d) (((n) + (d) / 2) / (d))
71
++
72
++static Display *xdpy;
73
++static Colormap xcmap;
74
++static XftDraw *xd;
75
++static Visual *xvis;
76
++
77
++static void drawbox(int, int, int, int, XftColor *, XftColor *, ushort);
78
++static void drawboxlines(int, int, int, int, XftColor *, ushort);
64 79
 +
65 80
 +/* public API */
66 81
 +
82
++void
83
++boxdraw_xinit(Display *dpy, Colormap cmap, XftDraw *draw, Visual *vis)
84
++{
85
++	xdpy = dpy; xcmap = cmap; xd = draw, xvis = vis;
86
++}
87
++
67 88
 +int
68
-+isboxdraw(const Glyph *g)
89
++isboxdraw(Rune u)
69 90
 +{
70
-+	return (g->u & ~0xff) == 0x2500 &&
71
-+	       boxdata[(uint8_t)g->u] != 0 &&
72
-+	       (g->mode & ATTR_ITALIC) == 0;
91
++	Rune block = u & ~0xff;
92
++	return (boxdraw && block == 0x2500 && boxdata[(uint8_t)u]) ||
93
++	       (boxdraw_braille && block == 0x2800);
73 94
 +}
74 95
 +
75 96
 +/* the "index" is actually the entire shape data encoded as ushort */
76 97
 +ushort
77 98
 +boxdrawindex(const Glyph *g)
78 99
 +{
79
-+	return boxdata[(uint8_t)g->u] | ((g->mode & ATTR_BOLD) ? BDB : 0);
100
++	if (boxdraw_braille && (g->u & ~0xff) == 0x2800)
101
++		return BRL | (uint8_t)g->u;
102
++	if (boxdraw_bold && (g->mode & ATTR_BOLD))
103
++		return BDB | boxdata[(uint8_t)g->u];
104
++	return boxdata[(uint8_t)g->u];
80 105
 +}
81 106
 +
82 107
 +void
83
-+drawboxes(XftDraw *xd, int x, int y, int cw, int ch, XftColor *fg,
108
++drawboxes(int x, int y, int cw, int ch, XftColor *fg, XftColor *bg,
84 109
 +          const XftGlyphFontSpec *specs, int len)
85 110
 +{
86 111
 +	for ( ; len-- > 0; x += cw, specs++)
87
-+		drawbox(xd, x, y, cw, ch, fg, (ushort)specs->glyph);
112
++		drawbox(x, y, cw, ch, fg, bg, (ushort)specs->glyph);
88 113
 +}
89 114
 +
90 115
 +/* implementation */
91 116
 +
92 117
 +void
93
-+drawbox(XftDraw *xd, int x, int y, int w, int h, XftColor *fg, ushort bd)
118
++drawbox(int x, int y, int w, int h, XftColor *fg, XftColor *bg, ushort bd)
94 119
 +{
120
++	ushort cat = bd & ~(BDB | 0xff);  /* mask out bold and data */
95 121
 +	if (bd & (BDL | BDA)) {
96 122
 +		/* lines (light/double/heavy/arcs) */
97
-+		drawboxlines(xd, x, y, w, h, fg, bd);
123
++		drawboxlines(x, y, w, h, fg, bd);
98 124
 +
99
-+	} else if (bd & BBD) {
125
++	} else if (cat == BBD) {
100 126
 +		/* lower (8-X)/8 block */
101
-+		int d = ((uint8_t)bd * h + 4) / 8;
127
++		int d = DIV((uint8_t)bd * h, 8);
102 128
 +		XftDrawRect(xd, fg, x, y + d, w, h - d);
103 129
 +
104
-+	} else if (bd & BBU) {
130
++	} else if (cat == BBU) {
105 131
 +		/* upper X/8 block */
106
-+		XftDrawRect(xd, fg, x, y, w, ((uint8_t)bd * h + 4) / 8);
132
++		XftDrawRect(xd, fg, x, y, w, DIV((uint8_t)bd * h, 8));
107 133
 +
108
-+	} else if (bd & BBL) {
134
++	} else if (cat == BBL) {
109 135
 +		/* left X/8 block */
110
-+		XftDrawRect(xd, fg, x, y, ((uint8_t)bd * w + 4) / 8, h);
136
++		XftDrawRect(xd, fg, x, y, DIV((uint8_t)bd * w, 8), h);
111 137
 +
112
-+	} else if (bd & BBR) {
138
++	} else if (cat == BBR) {
113 139
 +		/* right (8-X)/8 block */
114
-+		int d = ((uint8_t)bd * w + 4) / 8;
140
++		int d = DIV((uint8_t)bd * w, 8);
115 141
 +		XftDrawRect(xd, fg, x + d, y, w - d, h);
116 142
 +
117
-+	} else if (bd & BBQ) {
143
++	} else if (cat == BBQ) {
118 144
 +		/* Quadrants */
119
-+		int w2 = (w + 1) / 2, h2 = (h + 1) / 2;
145
++		int w2 = DIV(w, 2), h2 = DIV(h, 2);
120 146
 +		if (bd & TL)
121 147
 +			XftDrawRect(xd, fg, x, y, w2, h2);
122 148
 +		if (bd & TR)
@@ -125,20 +151,49 @@ index 0000000..357250f
125 151
 +			XftDrawRect(xd, fg, x, y + h2, w2, h - h2);
126 152
 +		if (bd & BR)
127 153
 +			XftDrawRect(xd, fg, x + w2, y + h2, w - w2, h - h2);
154
++
155
++	} else if (bd & BBS) {
156
++		/* Shades - data is 1/2/3 for 25%/50%/75% alpha, respectively */
157
++		int d = (uint8_t)bd;
158
++		XftColor xfc;
159
++		XRenderColor xrc = { .alpha = 0xffff };
160
++
161
++		xrc.red = DIV(fg->color.red * d + bg->color.red * (4 - d), 4);
162
++		xrc.green = DIV(fg->color.green * d + bg->color.green * (4 - d), 4);
163
++		xrc.blue = DIV(fg->color.blue * d + bg->color.blue * (4 - d), 4);
164
++
165
++		XftColorAllocValue(xdpy, xvis, xcmap, &xrc, &xfc);
166
++		XftDrawRect(xd, &xfc, x, y, w, h);
167
++		XftColorFree(xdpy, xvis, xcmap, &xfc);
168
++
169
++	} else if (cat == BRL) {
170
++		/* braille, each data bit corresponds to one dot at 2x4 grid */
171
++		int w1 = DIV(w, 2);
172
++		int h1 = DIV(h, 4), h2 = DIV(h, 2), h3 = DIV(3 * h, 4);
173
++
174
++		if (bd & 1)   XftDrawRect(xd, fg, x, y, w1, h1);
175
++		if (bd & 2)   XftDrawRect(xd, fg, x, y + h1, w1, h2 - h1);
176
++		if (bd & 4)   XftDrawRect(xd, fg, x, y + h2, w1, h3 - h2);
177
++		if (bd & 8)   XftDrawRect(xd, fg, x + w1, y, w - w1, h1);
178
++		if (bd & 16)  XftDrawRect(xd, fg, x + w1, y + h1, w - w1, h2 - h1);
179
++		if (bd & 32)  XftDrawRect(xd, fg, x + w1, y + h2, w - w1, h3 - h2);
180
++		if (bd & 64)  XftDrawRect(xd, fg, x, y + h3, w1, h - h3);
181
++		if (bd & 128) XftDrawRect(xd, fg, x + w1, y + h3, w - w1, h - h3);
182
++
128 183
 +	}
129 184
 +}
130 185
 +
131 186
 +void
132
-+drawboxlines(XftDraw *xd, int x, int y, int w, int h, XftColor *fg, ushort bd)
187
++drawboxlines(int x, int y, int w, int h, XftColor *fg, ushort bd)
133 188
 +{
134 189
 +	/* s: stem thickness. width/8 roughly matches underscore thickness. */
135 190
 +	/* We draw bold as 1.5 * normal-stem and at least 1px thicker.      */
136 191
 +	/* doubles draw at least 3px, even when w or h < 3. bold needs 6px. */
137 192
 +	int mwh = MIN(w, h);
138
-+	int base_s = MAX(1, (mwh + 4) / 8);
193
++	int base_s = MAX(1, DIV(mwh, 8));
139 194
 +	int bold = (bd & BDB) && mwh >= 6;  /* possibly ignore boldness */
140
-+	int s = bold ? MAX(base_s + 1, (3 * base_s + 1) / 2) : base_s;
141
-+	int w2 = (w - s + 1) / 2, h2 = (h - s + 1) / 2;
195
++	int s = bold ? MAX(base_s + 1, DIV(3 * base_s, 2)) : base_s;
196
++	int w2 = DIV(w - s, 2), h2 = DIV(h - s, 2);
142 197
 +	/* the s-by-s square (x + w2, y + h2, s, s) is the center texel.    */
143 198
 +	/* The base length (per direction till edge) includes this square.  */
144 199
 +
@@ -198,10 +253,15 @@ index 0000000..357250f
198 253
 +}
199 254
 diff --git a/boxdraw_data.h b/boxdraw_data.h
200 255
 new file mode 100644
201
-index 0000000..ee78cdc
256
+index 0000000..7890500
202 257
 --- /dev/null
203 258
 +++ b/boxdraw_data.h
204
-@@ -0,0 +1,202 @@
259
+@@ -0,0 +1,214 @@
260
++/*
261
++ * Copyright 2018 Avi Halachmi (:avih) avihpit@yahoo.com https://github.com/avih
262
++ * MIT/X Consortium License
263
++ */
264
++
205 265
 +/*
206 266
 + * U+25XX codepoints data
207 267
 + *
@@ -215,13 +275,18 @@ index 0000000..ee78cdc
215 275
 +
216 276
 +/* Each shape is encoded as 16-bits. Higher bits are category, lower are data */
217 277
 +/* Categories (mutually exclusive except BDB): */
278
++/* For convenience, BDL/BDA/BBS/BDB are 1 bit each, the rest are enums */
218 279
 +#define BDL (1<<8)   /* Box Draw Lines (light/double/heavy) */
219 280
 +#define BDA (1<<9)   /* Box Draw Arc (light) */
281
++
220 282
 +#define BBD (1<<10)  /* Box Block Down (lower) X/8 */
221
-+#define BBL (1<<11)  /* Box Block Left X/8 */
222
-+#define BBU (1<<12)  /* Box Block Upper X/8 */
223
-+#define BBR (1<<13)  /* Box Block Right X/8 */
224
-+#define BBQ (1<<14)  /* Box Block Quadrants */
283
++#define BBL (2<<10)  /* Box Block Left X/8 */
284
++#define BBU (3<<10)  /* Box Block Upper X/8 */
285
++#define BBR (4<<10)  /* Box Block Right X/8 */
286
++#define BBQ (5<<10)  /* Box Block Quadrants */
287
++#define BRL (6<<10)  /* Box Braille (data is lower byte of U28XX) */
288
++
289
++#define BBS (1<<14)  /* Box Block Shades */
225 290
 +#define BDB (1<<15)  /* Box Draw is Bold */
226 291
 +
227 292
 +/* (BDL/BDA) Light/Double/Heavy x Left/Up/Right/Down/Horizontal/Vertical      */
@@ -253,7 +318,7 @@ index 0000000..ee78cdc
253 318
 +#define BL (1<<2)
254 319
 +#define BR (1<<3)
255 320
 +
256
-+/* 138 shapes are supported: U+2500 - U+259F except dashes/diagonals/shades */
321
++/* Data for U+2500 - U+259F except dashes/diagonals */
257 322
 +static const unsigned short boxdata[256] = {
258 323
 +	/* light lines */
259 324
 +	[0x00] = BDL + LH,       /* light horizontal */
@@ -400,45 +465,51 @@ index 0000000..ee78cdc
400 465
 +	[0x9e] = BBQ + BL + TR,
401 466
 +	[0x9f] = BBQ + BL + TR + BR,
402 467
 +
468
++	/* Shades, data is an alpha value in 25% units (1/4, 1/2, 3/4) */
469
++	[0x91] = BBS + 1, [0x92] = BBS + 2, [0x93] = BBS + 3,
470
++
403 471
 +	/* U+2504 - U+250B, U+254C - U+254F: unsupported (dashes) */
404 472
 +	/* U+2571 - U+2573: unsupported (diagonals) */
405
-+	/* U+2591 - U+2593: unsupported (shades) */
406 473
 +};
407 474
 diff --git a/config.def.h b/config.def.h
408
-index 823e79f..018cbe4 100644
475
+index 0e01717..e3654a9 100644
409 476
 --- a/config.def.h
410 477
 +++ b/config.def.h
411
-@@ -56,6 +56,14 @@ static unsigned int blinktimeout = 800;
478
+@@ -56,6 +56,18 @@ static unsigned int blinktimeout = 800;
412 479
   */
413 480
  static unsigned int cursorthickness = 2;
414 481
  
415 482
 +/*
416
-+ * 1: custom-draw (without using the font) most of the lines/blocks characters
417
-+ *    for gapless alignment between cells. This includes all the codepoints at
418
-+ *    U+2500 - U+259F except dashes, diagonals and shades.
419
-+ * 0: disable (render all glyphs normally from the font).
483
++ * 1: render most of the lines/blocks characters without using the font for
484
++ *    perfect alignment between cells (U2500 - U259F except dashes/diagonals).
485
++ *    Bold affects lines thickness if boxdraw_bold is not 0. Italic is ignored.
486
++ * 0: disable (render all U25XX glyphs normally from the font).
420 487
 + */
421 488
 +const int boxdraw = 0;
489
++const int boxdraw_bold = 0;
490
++
491
++/* braille (U28XX):  1: render as adjacent "pixels",  0: use font */
492
++const int boxdraw_braille = 0;
422 493
 +
423 494
  /*
424 495
   * bell volume. It must be a value between -100 and 100. Use 0 for disabling
425 496
   * it
426 497
 diff --git a/st.c b/st.c
427
-index 46cf2da..7ee136a 100644
498
+index b8e6077..d65f722 100644
428 499
 --- a/st.c
429 500
 +++ b/st.c
430
-@@ -1228,6 +1228,9 @@ tsetchar(Rune u, Glyph *attr, int x, int y)
501
+@@ -1230,6 +1230,9 @@ tsetchar(Rune u, Glyph *attr, int x, int y)
431 502
  	term.dirty[y] = 1;
432 503
  	term.line[y][x] = *attr;
433 504
  	term.line[y][x].u = u;
434 505
 +
435
-+	if (boxdraw && isboxdraw(&term.line[y][x]))
506
++	if (isboxdraw(u))
436 507
 +		term.line[y][x].mode |= ATTR_BOXDRAW;
437 508
  }
438 509
  
439 510
  void
440 511
 diff --git a/st.h b/st.h
441
-index 38c61c4..fc68c3b 100644
512
+index 38c61c4..9275632 100644
442 513
 --- a/st.h
443 514
 +++ b/st.h
444 515
 @@ -33,6 +33,7 @@ enum glyph_attribute {
@@ -449,30 +520,40 @@ index 38c61c4..fc68c3b 100644
449 520
  	ATTR_BOLD_FAINT = ATTR_BOLD | ATTR_FAINT,
450 521
  };
451 522
  
452
-@@ -110,6 +111,13 @@ void *xmalloc(size_t);
523
+@@ -110,6 +111,14 @@ void *xmalloc(size_t);
453 524
  void *xrealloc(void *, size_t);
454 525
  char *xstrdup(char *);
455 526
  
456
-+int isboxdraw(const Glyph *);
527
++int isboxdraw(Rune);
457 528
 +ushort boxdrawindex(const Glyph *);
458 529
 +#ifdef XFT_VERSION
459 530
 +/* only exposed to x.c, otherwise we'll need Xft.h for the types */
460
-+void drawboxes(XftDraw *, int, int, int, int, XftColor *, const XftGlyphFontSpec *, int);
531
++void boxdraw_xinit(Display *, Colormap, XftDraw *, Visual *);
532
++void drawboxes(int, int, int, int, XftColor *, XftColor *, const XftGlyphFontSpec *, int);
461 533
 +#endif
462 534
 +
463 535
  /* config.h globals */
464 536
  extern char *utmp;
465 537
  extern char *stty_args;
466
-@@ -120,3 +128,4 @@ extern char *termname;
538
+@@ -120,3 +129,4 @@ extern char *termname;
467 539
  extern unsigned int tabspaces;
468 540
  extern unsigned int defaultfg;
469 541
  extern unsigned int defaultbg;
470
-+extern const int boxdraw;
542
++extern const int boxdraw, boxdraw_bold, boxdraw_braille;
471 543
 diff --git a/x.c b/x.c
472
-index 00cb6b1..730f525 100644
544
+index 0422421..c740bed 100644
473 545
 --- a/x.c
474 546
 +++ b/x.c
475
-@@ -1164,8 +1164,13 @@ xmakeglyphfontspecs(XftGlyphFontSpec *specs, const Glyph *glyphs, int len, int x
547
+@@ -1118,6 +1118,8 @@ xinit(int cols, int rows)
548
+ 	xsel.xtarget = XInternAtom(xw.dpy, "UTF8_STRING", 0);
549
+ 	if (xsel.xtarget == None)
550
+ 		xsel.xtarget = XA_STRING;
551
++
552
++	boxdraw_xinit(xw.dpy, xw.cmap, xw.draw, xw.vis);
553
+ }
554
+ 
555
+ int
556
+@@ -1164,8 +1166,13 @@ xmakeglyphfontspecs(XftGlyphFontSpec *specs, const Glyph *glyphs, int len, int x
476 557
  			yp = winy + font->ascent;
477 558
  		}
478 559
  
@@ -488,14 +569,14 @@ index 00cb6b1..730f525 100644
488 569
  		if (glyphidx) {
489 570
  			specs[numspecs].font = font->match;
490 571
  			specs[numspecs].glyph = glyphidx;
491
-@@ -1372,8 +1377,12 @@ xdrawglyphfontspecs(const XftGlyphFontSpec *specs, Glyph base, int len, int x, i
572
+@@ -1372,8 +1379,12 @@ xdrawglyphfontspecs(const XftGlyphFontSpec *specs, Glyph base, int len, int x, i
492 573
  	r.width = width;
493 574
  	XftDrawSetClipRectangles(xw.draw, winx, winy, &r, 1);
494 575
  
495 576
 -	/* Render the glyphs. */
496 577
 -	XftDrawGlyphFontSpec(xw.draw, fg, specs, len);
497 578
 +	if (base.mode & ATTR_BOXDRAW) {
498
-+		drawboxes(xw.draw, winx, winy, width / len, win.ch, fg, specs, len);
579
++		drawboxes(winx, winy, width / len, win.ch, fg, bg, specs, len);
499 580
 +	} else {
500 581
 +		/* Render the glyphs. */
501 582
 +		XftDrawGlyphFontSpec(xw.draw, fg, specs, len);
@@ -503,7 +584,7 @@ index 00cb6b1..730f525 100644
503 584
  
504 585
  	/* Render underline and strikethrough. */
505 586
  	if (base.mode & ATTR_UNDERLINE) {
506
-@@ -1416,7 +1425,7 @@ xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og)
587
+@@ -1416,7 +1427,7 @@ xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og)
507 588
  	/*
508 589
  	 * Select the right color for the right mode.
509 590
  	 */
@@ -513,5 +594,5 @@ index 00cb6b1..730f525 100644
513 594
  	if (IS_SET(MODE_REVERSE)) {
514 595
  		g.mode |= ATTR_REVERSE;
515 596
 -- 
516
-2.19.1
597
+2.17.1
517 598
 

Loading…
Cancel
Save