From aabc6c2b1464d67bf65c712ce7a0ef636032eee9 Mon Sep 17 00:00:00 2001 From: Luca Bilke Date: Sat, 6 Apr 2024 14:49:55 +0200 Subject: [PATCH] configure firacode font features, cleanup --- build.sh | 2 + patches/font-features.diff | 19 ++++++++++ ...213-9846a56.diff => selection-colors.diff} | 38 ------------------- 3 files changed, 21 insertions(+), 38 deletions(-) create mode 100644 patches/font-features.diff rename patches/{st-selectioncolors-20231213-9846a56.diff => selection-colors.diff} (62%) diff --git a/build.sh b/build.sh index eae22f4..f114dbb 100755 --- a/build.sh +++ b/build.sh @@ -7,3 +7,5 @@ for patch in patches/*.diff; do patch -d st-final <"$patch" done cp -f config.h st-final/ +cd st-final || exit 1 +make diff --git a/patches/font-features.diff b/patches/font-features.diff new file mode 100644 index 0000000..d545164 --- /dev/null +++ b/patches/font-features.diff @@ -0,0 +1,19 @@ +--- a/hb.c ++++ b/hb.c +@@ -27,7 +27,15 @@ static HbFontMatch *hbfontcache = NULL; + * e. g. + * FEATURE('c', 'a', 'l', 't'), FEATURE('d', 'l', 'i', 'g') + */ +-hb_feature_t features[] = { 0 }; ++hb_feature_t features[] = { ++ FEATURE('c','v','0','2'), ++ FEATURE('c','v','1','6'), ++ FEATURE('s','s','0','2'), ++ FEATURE('s','s','0','3'), ++ FEATURE('s','s','0','7'), ++ FEATURE('s','s','0','8'), ++ FEATURE('s','s','0','9'), ++}; + + void + hbunloadfonts() diff --git a/patches/st-selectioncolors-20231213-9846a56.diff b/patches/selection-colors.diff similarity index 62% rename from patches/st-selectioncolors-20231213-9846a56.diff rename to patches/selection-colors.diff index f05567a..18a1b4d 100644 --- a/patches/st-selectioncolors-20231213-9846a56.diff +++ b/patches/selection-colors.diff @@ -1,39 +1,3 @@ -diff --git a/config.def.h b/config.def.h -index 27c811e..205478f 100644 ---- a/config.def.h -+++ b/config.def.h -@@ -152,7 +152,7 @@ static const char *colorname[] = { - - /* more colors can be added after 255 to use with DefaultXX */ - "#add8e6", /* 256 -> cursor */ -- "#555555", /* 257 -> rev cursor*/ -+ "#2e3440", /* 257 -> rev cursor*/ - "#000000", /* 258 -> bg */ - "#e5e5e5", /* 259 -> fg */ - }; -@@ -160,13 +160,18 @@ static const char *colorname[] = { - - /* - * Default colors (colorname index) -- * foreground, background, cursor, reverse cursor -++ * foreground, background, cursor, reverse cursor, selection - */ - unsigned int defaultbg = 0; - unsigned int bg = 17, bgUnfocused = 16; - unsigned int defaultfg = 259; - unsigned int defaultcs = 256; --unsigned int defaultrcs = 257; -+unsigned int defaultrcs = 256; -+unsigned int selectionbg = 257; -+unsigned int selectionfg = 7; -+/* If 0 use selectionfg as foreground in order to have a uniform foreground-color */ -+/* Else if 1 keep original foreground-color of each cell => more colors :) */ -+static int ignoreselfg = 1; - - - /* -diff --git a/st.h b/st.h -index 0810857..488ec5e 100644 --- a/st.h +++ b/st.h @@ -43,6 +43,7 @@ enum glyph_attribute { @@ -44,8 +8,6 @@ index 0810857..488ec5e 100644 ATTR_BOLD_FAINT = ATTR_BOLD | ATTR_FAINT, ATTR_DIRTYUNDERLINE = 1 << 15, }; -diff --git a/x.c b/x.c -index c6313a3..5f12039 100644 --- a/x.c +++ b/x.c @@ -1568,6 +1568,12 @@ xdrawglyphfontspecs(const XftGlyphFontSpec *specs, Glyph base, int len, int x, i