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

This commit is contained in:
Von Random 2019-04-23 02:33:35 +03:00
parent 0003366d84
commit 2ecdab50ad
5 changed files with 33 additions and 18 deletions

View file

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

2
makest
View file

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

View file

@ -12,13 +12,19 @@
unsigned int defaultbg = 0; unsigned int defaultbg = 0;
static unsigned int defaultcs = 256; static unsigned int defaultcs = 256;
static unsigned int defaultrcs = 257; static unsigned int defaultrcs = 257;
diff --git a/st.c b/st.c
index ede7ae6..e67ef3b 100644
--- a/st.c --- a/st.c
+++ b/st.c +++ b/st.c
@@ -1378,9 +1378,12 @@ tsetattr(int *attr, int l) @@ -1351,6 +1351,7 @@ tsetattr(int *attr, int l)
ATTR_STRUCK ); for (i = 0; i < l; i++) {
term.c.attr.fg = defaultfg; switch (attr[i]) {
term.c.attr.bg = defaultbg; case 0:
+ term.c.attr.colored = 0; + term.c.attr.colored = 0;
term.c.attr.mode &= ~(
ATTR_BOLD |
ATTR_FAINT |
@@ -1365,6 +1366,8 @@ tsetattr(int *attr, int l)
break; break;
case 1: case 1:
term.c.attr.mode |= ATTR_BOLD; term.c.attr.mode |= ATTR_BOLD;
@ -27,35 +33,42 @@
break; break;
case 2: case 2:
term.c.attr.mode |= ATTR_FAINT; 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; term.c.attr.mode &= ~ATTR_STRUCK;
break; break;
case 38: case 38:
- if ((idx = tdefcolor(attr, &i, l)) >= 0) - if ((idx = tdefcolor(attr, &i, l)) >= 0)
+ 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.colored = 1;
term.c.attr.fg = idx;
+ } + }
break; break;
case 39: case 39:
term.c.attr.fg = defaultfg; - term.c.attr.fg = defaultfg;
+ term.c.attr.colored = 0; + term.c.attr.colored = 0;
+ if (term.c.attr.mode & ATTR_BOLD) {
+ term.c.attr.fg = defaultbd;
+ } else {
+ term.c.attr.fg = defaultfg;
+ }
break; break;
case 48: case 48:
if ((idx = tdefcolor(attr, &i, l)) >= 0) 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: default:
if (BETWEEN(attr[i], 30, 37)) { if (BETWEEN(attr[i], 30, 37)) {
term.c.attr.fg = attr[i] - 30;
+ term.c.attr.colored = 1; + term.c.attr.colored = 1;
term.c.attr.fg = attr[i] - 30;
} else if (BETWEEN(attr[i], 40, 47)) { } else if (BETWEEN(attr[i], 40, 47)) {
term.c.attr.bg = attr[i] - 40; term.c.attr.bg = attr[i] - 40;
} else if (BETWEEN(attr[i], 90, 97)) { } else if (BETWEEN(attr[i], 90, 97)) {
term.c.attr.fg = attr[i] - 90 + 8;
+ term.c.attr.colored = 1; + term.c.attr.colored = 1;
term.c.attr.fg = attr[i] - 90 + 8;
} else if (BETWEEN(attr[i], 100, 107)) { } else if (BETWEEN(attr[i], 100, 107)) {
term.c.attr.bg = attr[i] - 100 + 8; term.c.attr.bg = attr[i] - 100 + 8;
} else { diff --git a/st.h b/st.h
index 4da3051..06de8ac 100644
--- a/st.h --- a/st.h
+++ b/st.h +++ b/st.h
@@ -65,6 +65,7 @@ typedef struct { @@ -65,6 +65,7 @@ typedef struct {

View file

@ -11,9 +11,11 @@
/* /*
* What program is execed by st depends of these precedence rules: * What program is execed by st depends of these precedence rules:
* 1: program passed with -e * 1: program passed with -e
diff --git a/x.c b/x.c
index 5828a3b..c433c58 100644
--- a/x.c --- a/x.c
+++ b/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 */ static int oldbutton = 3; /* button event on startup: 3 = release */
@ -24,7 +26,7 @@
void void
clipcopy(const Arg *dummy) 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; frcflags = FRC_NORMAL;
runewidth = win.cw * ((mode & ATTR_WIDE) ? 2.0f : 1.0f); runewidth = win.cw * ((mode & ATTR_WIDE) ? 2.0f : 1.0f);
if ((mode & ATTR_ITALIC) && (mode & ATTR_BOLD)) { if ((mode & ATTR_ITALIC) && (mode & ATTR_BOLD)) {

View file

@ -1,6 +1,6 @@
--- a/x.c --- a/x.c
+++ b/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]; bg = &dc.col[base.bg];
} }