summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVon Random <von@vdrandom.org>2019-04-23 02:33:35 +0300
committerVon Random <von@vdrandom.org>2019-04-23 02:33:35 +0300
commit2ecdab50ad7ae646e7e7825a4a145658bc329150 (patch)
treef3154f7da56ddb97553825aadc4682f1e61cb00c
parent0003366d84e3012c31414ec5949a24ed05a15f5a (diff)
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
-rw-r--r--config.h6
-rwxr-xr-xmakest2
-rw-r--r--st-bright-bold-text.patch35
-rw-r--r--st-disable-bold-italic-fonts.patch6
-rw-r--r--st-disable-intensity-styles.patch2
5 files changed, 33 insertions, 18 deletions
diff --git a/config.h b/config.h
index 5171250..9ec1ed4 100644
--- a/config.h
+++ b/config.h
@@ -9,8 +9,8 @@ static char *font = "xos4 Terminus:bold:pixelsize=14";
static int borderpx = 1;
/* disable bold and italic font styles */
-int disablebold = 1;
-int disableitalic = 1;
+// int disablebold = 1;
+// int disableitalic = 1;
/*
* What program is execed by st depends of these precedence rules:
@@ -79,7 +79,7 @@ const int boxdraw_braille = 0;
static int bellvolume = 0;
/* default TERM value */
-char *termname = "st-256color";
+char *termname = "st-direct";
/*
* spaces per tab
diff --git a/makest b/makest
index 9a8d881..e0c04de 100755
--- a/makest
+++ b/makest
@@ -7,7 +7,7 @@ PATCHLIST=(
st-bright-bold-text.patch
st-clipboard.patch
st-direct-terminfo.patch
- st-disable-bold-italic-fonts.patch
+ # st-disable-bold-italic-fonts.patch
st-disable-intensity-styles.patch
)
MAKE_OPTS=(
diff --git a/st-bright-bold-text.patch b/st-bright-bold-text.patch
index 0640f07..e18a758 100644
--- a/st-bright-bold-text.patch
+++ b/st-bright-bold-text.patch
@@ -12,13 +12,19 @@
unsigned int defaultbg = 0;
static unsigned int defaultcs = 256;
static unsigned int defaultrcs = 257;
+diff --git a/st.c b/st.c
+index ede7ae6..e67ef3b 100644
--- a/st.c
+++ b/st.c
-@@ -1378,9 +1378,12 @@ tsetattr(int *attr, int l)
- ATTR_STRUCK );
- term.c.attr.fg = defaultfg;
- term.c.attr.bg = defaultbg;
+@@ -1351,6 +1351,7 @@ tsetattr(int *attr, int l)
+ for (i = 0; i < l; i++) {
+ switch (attr[i]) {
+ case 0:
+ term.c.attr.colored = 0;
+ term.c.attr.mode &= ~(
+ ATTR_BOLD |
+ ATTR_FAINT |
+@@ -1365,6 +1366,8 @@ tsetattr(int *attr, int l)
break;
case 1:
term.c.attr.mode |= ATTR_BOLD;
@@ -27,35 +33,42 @@
break;
case 2:
term.c.attr.mode |= ATTR_FAINT;
-@@ -1427,11 +1430,14 @@ tsetattr(int *attr, int l)
+@@ -1411,11 +1414,18 @@ tsetattr(int *attr, int l)
term.c.attr.mode &= ~ATTR_STRUCK;
break;
case 38:
- if ((idx = tdefcolor(attr, &i, l)) >= 0)
+ if ((idx = tdefcolor(attr, &i, l)) >= 0) {
- term.c.attr.fg = idx;
+ term.c.attr.colored = 1;
+ term.c.attr.fg = idx;
+ }
break;
case 39:
- term.c.attr.fg = defaultfg;
+- term.c.attr.fg = defaultfg;
+ term.c.attr.colored = 0;
++ if (term.c.attr.mode & ATTR_BOLD) {
++ term.c.attr.fg = defaultbd;
++ } else {
++ term.c.attr.fg = defaultfg;
++ }
break;
case 48:
if ((idx = tdefcolor(attr, &i, l)) >= 0)
-@@ -1443,10 +1449,12 @@ tsetattr(int *attr, int l)
+@@ -1426,10 +1436,12 @@ tsetattr(int *attr, int l)
+ break;
default:
if (BETWEEN(attr[i], 30, 37)) {
- term.c.attr.fg = attr[i] - 30;
+ term.c.attr.colored = 1;
+ term.c.attr.fg = attr[i] - 30;
} else if (BETWEEN(attr[i], 40, 47)) {
term.c.attr.bg = attr[i] - 40;
} else if (BETWEEN(attr[i], 90, 97)) {
- term.c.attr.fg = attr[i] - 90 + 8;
+ term.c.attr.colored = 1;
+ term.c.attr.fg = attr[i] - 90 + 8;
} else if (BETWEEN(attr[i], 100, 107)) {
term.c.attr.bg = attr[i] - 100 + 8;
- } else {
+diff --git a/st.h b/st.h
+index 4da3051..06de8ac 100644
--- a/st.h
+++ b/st.h
@@ -65,6 +65,7 @@ typedef struct {
diff --git a/st-disable-bold-italic-fonts.patch b/st-disable-bold-italic-fonts.patch
index a19584e..e7fa6e3 100644
--- a/st-disable-bold-italic-fonts.patch
+++ b/st-disable-bold-italic-fonts.patch
@@ -11,9 +11,11 @@
/*
* What program is execed by st depends of these precedence rules:
* 1: program passed with -e
+diff --git a/x.c b/x.c
+index 5828a3b..c433c58 100644
--- a/x.c
+++ b/x.c
-@@ -240,6 +240,10 @@ static char *opt_title = NULL;
+@@ -244,6 +244,10 @@ static char *opt_title = NULL;
static int oldbutton = 3; /* button event on startup: 3 = release */
@@ -24,7 +26,7 @@
void
clipcopy(const Arg *dummy)
{
-@@ -1152,13 +1156,15 @@ xmakeglyphfontspecs(XftGlyphFontSpec *specs, const Glyph *glyphs, int len, int x
+@@ -1177,13 +1181,15 @@ xmakeglyphfontspecs(XftGlyphFontSpec *specs, const Glyph *glyphs, int len, int x
frcflags = FRC_NORMAL;
runewidth = win.cw * ((mode & ATTR_WIDE) ? 2.0f : 1.0f);
if ((mode & ATTR_ITALIC) && (mode & ATTR_BOLD)) {
diff --git a/st-disable-intensity-styles.patch b/st-disable-intensity-styles.patch
index 8b158b7..7be92fc 100644
--- a/st-disable-intensity-styles.patch
+++ b/st-disable-intensity-styles.patch
@@ -1,6 +1,6 @@
--- a/x.c
+++ b/x.c
-@@ -1296,10 +1296,6 @@ xdrawglyphfontspecs(const XftGlyphFontSpec *specs, Glyph base, int len, int x, i
+@@ -1318,10 +1318,6 @@ xdrawglyphfontspecs(const XftGlyphFontSpec *specs, Glyph base, int len, int x, i
bg = &dc.col[base.bg];
}