summaryrefslogtreecommitdiff
path: root/x11-terms
diff options
context:
space:
mode:
Diffstat (limited to 'x11-terms')
-rw-r--r--x11-terms/st/files/01_disable-bold-italic-fonts-0.8.2.diff70
-rw-r--r--x11-terms/st/files/01_disable-bold-italic.diff22
-rw-r--r--x11-terms/st/files/02_any-geometry-0.8.1.diff123
-rw-r--r--x11-terms/st/st-0.9.2.ebuild3
4 files changed, 195 insertions, 23 deletions
diff --git a/x11-terms/st/files/01_disable-bold-italic-fonts-0.8.2.diff b/x11-terms/st/files/01_disable-bold-italic-fonts-0.8.2.diff
new file mode 100644
index 0000000..385f1b4
--- /dev/null
+++ b/x11-terms/st/files/01_disable-bold-italic-fonts-0.8.2.diff
@@ -0,0 +1,70 @@
+From 0856fbfcdae3f8e48db791984591b0bb8a91de68 Mon Sep 17 00:00:00 2001
+From: Ryan Kes <alrayyes@gmail.com>
+Date: Fri, 29 Mar 2019 10:59:09 +0100
+Subject: [PATCH] st-disable-bold-italic-fonts-0.8.2
+
+---
+ config.def.h | 6 ++++++
+ x.c | 10 +++++++++-
+ 2 files changed, 15 insertions(+), 1 deletion(-)
+
+diff --git a/config.def.h b/config.def.h
+index 482901e..4f5aeac 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -6,6 +6,12 @@
+ * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
+ */
+ static char *font = "Liberation Mono:pixelsize=12:antialias=true:autohint=true";
++
++/* disable bold, italic and roman fonts globally */
++int disablebold = 0;
++int disableitalic = 0;
++int disableroman = 0;
++
+ static int borderpx = 2;
+
+ /*
+diff --git a/x.c b/x.c
+index 5828a3b..9663fa6 100644
+--- a/x.c
++++ b/x.c
+@@ -233,6 +233,11 @@ static char *usedfont = NULL;
+ static double usedfontsize = 0;
+ static double defaultfontsize = 0;
+
++/* declared in config.h */
++extern int disablebold;
++extern int disableitalic;
++extern int disableroman;
++
+ static char *opt_class = NULL;
+ static char **opt_cmd = NULL;
+ static char *opt_embed = NULL;
+@@ -966,17 +971,20 @@ xloadfonts(char *fontstr, double fontsize)
+ win.ch = ceilf(dc.font.height * chscale);
+
+ FcPatternDel(pattern, FC_SLANT);
+- FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ITALIC);
++ if (!disableitalic)
++ FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ITALIC);
+ if (xloadfont(&dc.ifont, pattern))
+ die("can't open font %s\n", fontstr);
+
+ FcPatternDel(pattern, FC_WEIGHT);
+- FcPatternAddInteger(pattern, FC_WEIGHT, FC_WEIGHT_BOLD);
++ if (!disablebold)
++ FcPatternAddInteger(pattern, FC_WEIGHT, FC_WEIGHT_BOLD);
+ if (xloadfont(&dc.ibfont, pattern))
+ die("can't open font %s\n", fontstr);
+
+ FcPatternDel(pattern, FC_SLANT);
+- FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ROMAN);
++ if (!disableroman)
++ FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ROMAN);
+ if (xloadfont(&dc.bfont, pattern))
+ die("can't open font %s\n", fontstr);
+
+--
+2.39.2
+
diff --git a/x11-terms/st/files/01_disable-bold-italic.diff b/x11-terms/st/files/01_disable-bold-italic.diff
deleted file mode 100644
index 147ffef..0000000
--- a/x11-terms/st/files/01_disable-bold-italic.diff
+++ /dev/null
@@ -1,22 +0,0 @@
-diff --git i/x.c w/x.c
-index d73152b..ab0a1ce 100644
---- i/x.c
-+++ w/x.c
-@@ -1033,17 +1033,14 @@ xloadfonts(const char *fontstr, double fontsize)
- win.ch = ceilf(dc.font.height * chscale);
-
- FcPatternDel(pattern, FC_SLANT);
-- FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ITALIC);
- if (xloadfont(&dc.ifont, pattern))
- die("can't open font %s\n", fontstr);
-
- FcPatternDel(pattern, FC_WEIGHT);
-- FcPatternAddInteger(pattern, FC_WEIGHT, FC_WEIGHT_BOLD);
- if (xloadfont(&dc.ibfont, pattern))
- die("can't open font %s\n", fontstr);
-
- FcPatternDel(pattern, FC_SLANT);
-- FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ROMAN);
- if (xloadfont(&dc.bfont, pattern))
- die("can't open font %s\n", fontstr);
-
diff --git a/x11-terms/st/files/02_any-geometry-0.8.1.diff b/x11-terms/st/files/02_any-geometry-0.8.1.diff
new file mode 100644
index 0000000..b04d36c
--- /dev/null
+++ b/x11-terms/st/files/02_any-geometry-0.8.1.diff
@@ -0,0 +1,123 @@
+From 6a5a862569912e34febe2dbd5244062013840204 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jos=C3=A9=20Miguel=20S=C3=A1nchez=20Garc=C3=ADa?=
+ <soy.jmi2k@gmail.com>
+Date: Thu, 13 Aug 2020 11:02:01 +0000
+Subject: [PATCH] add -G to set pixel-based geometry
+
+---
+ config.def.h | 13 +++++++++++++
+ x.c | 36 ++++++++++++++++++++++++++++++++----
+ 2 files changed, 45 insertions(+), 4 deletions(-)
+
+diff --git a/config.def.h b/config.def.h
+index 6f05dce..bea316a 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -141,6 +141,12 @@ static unsigned int defaultrcs = 257;
+ */
+ static unsigned int cursorshape = 2;
+
++/*
++ * Whether to use pixel geometry or cell geometry
++ */
++
++static Geometry geometry = CellGeometry;
++
+ /*
+ * Default columns and rows numbers
+ */
+@@ -148,6 +154,13 @@ static unsigned int cursorshape = 2;
+ static unsigned int cols = 80;
+ static unsigned int rows = 24;
+
++/*
++ * Default width and height (including borders!)
++ */
++
++static unsigned int width = 564;
++static unsigned int height = 364;
++
+ /*
+ * Default colour and shape of the mouse cursor
+ */
+diff --git a/x.c b/x.c
+index 210f184..29e35d0 100644
+--- a/x.c
++++ b/x.c
+@@ -45,6 +45,11 @@ typedef struct {
+ signed char appcursor; /* application cursor */
+ } Key;
+
++typedef enum {
++ PixelGeometry,
++ CellGeometry
++} Geometry;
++
+ /* X modifiers */
+ #define XK_ANY_MOD UINT_MAX
+ #define XK_NO_MOD 0
+@@ -1096,7 +1101,7 @@ xicdestroy(XIC xim, XPointer client, XPointer call)
+ }
+
+ void
+-xinit(int cols, int rows)
++xinit(int w, int h)
+ {
+ XGCValues gcvalues;
+ Cursor cursor;
+@@ -1121,8 +1126,16 @@ xinit(int cols, int rows)
+ xloadcols();
+
+ /* adjust fixed window geometry */
+- win.w = 2 * borderpx + cols * win.cw;
+- win.h = 2 * borderpx + rows * win.ch;
++ switch (geometry) {
++ case CellGeometry:
++ win.w = 2 * borderpx + w * win.cw;
++ win.h = 2 * borderpx + h * win.ch;
++ break;
++ case PixelGeometry:
++ win.w = w;
++ win.h = h;
++ break;
++ }
+ if (xw.gm & XNegative)
+ xw.l += DisplayWidth(xw.dpy, xw.scr) - win.w - 2;
+ if (xw.gm & YNegative)
+@@ -2001,6 +2014,12 @@ main(int argc, char *argv[])
+ case 'g':
+ xw.gm = XParseGeometry(EARGF(usage()),
+ &xw.l, &xw.t, &cols, &rows);
++ geometry = CellGeometry;
++ break;
++ case 'G':
++ xw.gm = XParseGeometry(EARGF(usage()),
++ &xw.l, &xw.t, &width, &height);
++ geometry = PixelGeometry;
+ break;
+ case 'i':
+ xw.isfixed = 1;
+@@ -2037,10 +2056,19 @@ run:
+
+ setlocale(LC_CTYPE, "");
+ XSetLocaleModifiers("");
++ switch (geometry) {
++ case CellGeometry:
++ xinit(cols, rows);
++ break;
++ case PixelGeometry:
++ xinit(width, height);
++ cols = (win.w - 2 * borderpx) / win.cw;
++ rows = (win.h - 2 * borderpx) / win.ch;
++ break;
++ }
+ cols = MAX(cols, 1);
+ rows = MAX(rows, 1);
+ tnew(cols, rows);
+- xinit(cols, rows);
+ xsetenv();
+ selinit();
+ run();
+--
+2.28.0
+
diff --git a/x11-terms/st/st-0.9.2.ebuild b/x11-terms/st/st-0.9.2.ebuild
index dd6427e..f02ee87 100644
--- a/x11-terms/st/st-0.9.2.ebuild
+++ b/x11-terms/st/st-0.9.2.ebuild
@@ -17,7 +17,8 @@ else
fi
PATCHES=(
- "${FILESDIR}/01_disable-bold-italic.diff"
+ "${FILESDIR}/01_disable-bold-italic-fonts-0.8.2.diff"
+ "${FILESDIR}/02_any-geometry-0.8.1.diff"
)
LICENSE="MIT"