Browse Source

config: do not use st-bold-italic-fonts patch; st-bright-bold-text: 39 should not clear bright color on bold; st-disable-bold-italic-fonts, st-disable-intensity-styles: fix offsets

master
Von Random 1 month ago
parent
commit
2ecdab50ad
5 changed files with 33 additions and 18 deletions
  1. 3
    3
      config.h
  2. 1
    1
      makest
  3. 24
    11
      st-bright-bold-text.patch
  4. 4
    2
      st-disable-bold-italic-fonts.patch
  5. 1
    1
      st-disable-intensity-styles.patch

+ 3
- 3
config.h View File

@@ -9,8 +9,8 @@ static char *font = "xos4 Terminus:bold:pixelsize=14";
9 9
 static int borderpx = 1;
10 10
 
11 11
 /* disable bold and italic font styles */
12
-int disablebold = 1;
13
-int disableitalic = 1;
12
+// int disablebold = 1;
13
+// int disableitalic = 1;
14 14
 
15 15
 /*
16 16
  * What program is execed by st depends of these precedence rules:
@@ -79,7 +79,7 @@ const int boxdraw_braille = 0;
79 79
 static int bellvolume = 0;
80 80
 
81 81
 /* default TERM value */
82
-char *termname = "st-256color";
82
+char *termname = "st-direct";
83 83
 
84 84
 /*
85 85
  * spaces per tab

+ 1
- 1
makest View File

@@ -7,7 +7,7 @@ PATCHLIST=(
7 7
     st-bright-bold-text.patch
8 8
     st-clipboard.patch
9 9
     st-direct-terminfo.patch
10
-    st-disable-bold-italic-fonts.patch
10
+    # st-disable-bold-italic-fonts.patch
11 11
     st-disable-intensity-styles.patch
12 12
 )
13 13
 MAKE_OPTS=(

+ 24
- 11
st-bright-bold-text.patch View File

@@ -12,13 +12,19 @@
12 12
  unsigned int defaultbg = 0;
13 13
  static unsigned int defaultcs = 256;
14 14
  static unsigned int defaultrcs = 257;
15
+diff --git a/st.c b/st.c
16
+index ede7ae6..e67ef3b 100644
15 17
 --- a/st.c
16 18
 +++ b/st.c
17
-@@ -1378,9 +1378,12 @@ tsetattr(int *attr, int l)
18
- 				ATTR_STRUCK     );
19
- 			term.c.attr.fg = defaultfg;
20
- 			term.c.attr.bg = defaultbg;
19
+@@ -1351,6 +1351,7 @@ tsetattr(int *attr, int l)
20
+ 	for (i = 0; i < l; i++) {
21
+ 		switch (attr[i]) {
22
+ 		case 0:
21 23
 +			term.c.attr.colored = 0;
24
+ 			term.c.attr.mode &= ~(
25
+ 				ATTR_BOLD       |
26
+ 				ATTR_FAINT      |
27
+@@ -1365,6 +1366,8 @@ tsetattr(int *attr, int l)
22 28
  			break;
23 29
  		case 1:
24 30
  			term.c.attr.mode |= ATTR_BOLD;
@@ -27,35 +33,42 @@
27 33
  			break;
28 34
  		case 2:
29 35
  			term.c.attr.mode |= ATTR_FAINT;
30
-@@ -1427,11 +1430,14 @@ tsetattr(int *attr, int l)
36
+@@ -1411,11 +1414,18 @@ tsetattr(int *attr, int l)
31 37
  			term.c.attr.mode &= ~ATTR_STRUCK;
32 38
  			break;
33 39
  		case 38:
34 40
 -			if ((idx = tdefcolor(attr, &i, l)) >= 0)
35 41
 +			if ((idx = tdefcolor(attr, &i, l)) >= 0) {
36
- 				term.c.attr.fg = idx;
37 42
 +				term.c.attr.colored = 1;
43
+ 				term.c.attr.fg = idx;
38 44
 +			}
39 45
  			break;
40 46
  		case 39:
41
- 			term.c.attr.fg = defaultfg;
47
+-			term.c.attr.fg = defaultfg;
42 48
 +			term.c.attr.colored = 0;
49
++			if (term.c.attr.mode & ATTR_BOLD) {
50
++				term.c.attr.fg = defaultbd;
51
++			} else {
52
++				term.c.attr.fg = defaultfg;
53
++			}
43 54
  			break;
44 55
  		case 48:
45 56
  			if ((idx = tdefcolor(attr, &i, l)) >= 0)
46
-@@ -1443,10 +1449,12 @@ tsetattr(int *attr, int l)
57
+@@ -1426,10 +1436,12 @@ tsetattr(int *attr, int l)
58
+ 			break;
47 59
  		default:
48 60
  			if (BETWEEN(attr[i], 30, 37)) {
49
- 				term.c.attr.fg = attr[i] - 30;
50 61
 +				term.c.attr.colored = 1;
62
+ 				term.c.attr.fg = attr[i] - 30;
51 63
  			} else if (BETWEEN(attr[i], 40, 47)) {
52 64
  				term.c.attr.bg = attr[i] - 40;
53 65
  			} else if (BETWEEN(attr[i], 90, 97)) {
54
- 				term.c.attr.fg = attr[i] - 90 + 8;
55 66
 +				term.c.attr.colored = 1;
67
+ 				term.c.attr.fg = attr[i] - 90 + 8;
56 68
  			} else if (BETWEEN(attr[i], 100, 107)) {
57 69
  				term.c.attr.bg = attr[i] - 100 + 8;
58
- 			} else {
70
+diff --git a/st.h b/st.h
71
+index 4da3051..06de8ac 100644
59 72
 --- a/st.h
60 73
 +++ b/st.h
61 74
 @@ -65,6 +65,7 @@ typedef struct {

+ 4
- 2
st-disable-bold-italic-fonts.patch View File

@@ -11,9 +11,11 @@
11 11
  /*
12 12
   * What program is execed by st depends of these precedence rules:
13 13
   * 1: program passed with -e
14
+diff --git a/x.c b/x.c
15
+index 5828a3b..c433c58 100644
14 16
 --- a/x.c
15 17
 +++ b/x.c
16
-@@ -240,6 +240,10 @@ static char *opt_title = NULL;
18
+@@ -244,6 +244,10 @@ static char *opt_title = NULL;
17 19
  
18 20
  static int oldbutton = 3; /* button event on startup: 3 = release */
19 21
  
@@ -24,7 +26,7 @@
24 26
  void
25 27
  clipcopy(const Arg *dummy)
26 28
  {
27
-@@ -1152,13 +1156,15 @@ xmakeglyphfontspecs(XftGlyphFontSpec *specs, const Glyph *glyphs, int len, int x
29
+@@ -1177,13 +1181,15 @@ xmakeglyphfontspecs(XftGlyphFontSpec *specs, const Glyph *glyphs, int len, int x
28 30
  			frcflags = FRC_NORMAL;
29 31
  			runewidth = win.cw * ((mode & ATTR_WIDE) ? 2.0f : 1.0f);
30 32
  			if ((mode & ATTR_ITALIC) && (mode & ATTR_BOLD)) {

+ 1
- 1
st-disable-intensity-styles.patch View File

@@ -1,6 +1,6 @@
1 1
 --- a/x.c
2 2
 +++ b/x.c
3
-@@ -1296,10 +1296,6 @@ xdrawglyphfontspecs(const XftGlyphFontSpec *specs, Glyph base, int len, int x, i
3
+@@ -1318,10 +1318,6 @@ xdrawglyphfontspecs(const XftGlyphFontSpec *specs, Glyph base, int len, int x, i
4 4
  		bg = &dc.col[base.bg];
5 5
  	}
6 6
  

Loading…
Cancel
Save