diff options
author | mhsn <mail@mhsn.net> | 2025-07-20 09:57:26 +0100 |
---|---|---|
committer | mhsn <mail@mhsn.net> | 2025-07-20 09:57:26 +0100 |
commit | e24dfcbb8a69462ecd6cc5e7074d3afd458808a5 (patch) | |
tree | 6609170c8b3898a3ed25b5b14d4a601dbe11afd1 | |
parent | d85bf3344b4c7cfde883a617dc69d55197e449bd (diff) | |
download | adelie-e24dfcbb8a69462ecd6cc5e7074d3afd458808a5.tar.gz adelie-e24dfcbb8a69462ecd6cc5e7074d3afd458808a5.zip |
st: add fonts
-rw-r--r-- | x11-terms/st/files/03_cyclefonts.diff | 77 | ||||
-rw-r--r-- | x11-terms/st/files/50_cozette-font.diff | 16 | ||||
-rw-r--r-- | x11-terms/st/st-9999.ebuild | 9 |
3 files changed, 91 insertions, 11 deletions
diff --git a/x11-terms/st/files/03_cyclefonts.diff b/x11-terms/st/files/03_cyclefonts.diff new file mode 100644 index 0000000..ef92feb --- /dev/null +++ b/x11-terms/st/files/03_cyclefonts.diff @@ -0,0 +1,77 @@ +diff --git c/config.def.h i/config.def.h +index 851066f..7ca1274 100644 +--- c/config.def.h ++++ i/config.def.h +@@ -5,7 +5,11 @@ + * + * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html + */ +-static char *font = "Liberation Mono:pixelsize=12:antialias=true:autohint=true"; ++static char *fonts[] = { ++ "Liberation Mono:pixelsize=12:antialias=true:autohint=true", ++ "Gohu GohuFont:pixelsize=11:antialias=false:autohint=false", ++}; ++static size_t currentfont = 0; + + /* disable bold, italic and roman fonts globally */ + int disablebold = 1; +@@ -207,6 +211,7 @@ static Shortcut shortcuts[] = { + { TERMMOD, XK_Y, selpaste, {.i = 0} }, + { ShiftMask, XK_Insert, selpaste, {.i = 0} }, + { TERMMOD, XK_Num_Lock, numlock, {.i = 0} }, ++ { TERMMOD, XK_End, cyclefonts, {} }, + }; + + /* +diff --git c/x.c i/x.c +index dcc3930..a306253 100644 +--- c/x.c ++++ i/x.c +@@ -59,6 +59,7 @@ static void zoom(const Arg *); + static void zoomabs(const Arg *); + static void zoomreset(const Arg *); + static void ttysend(const Arg *); ++static void cyclefonts(const Arg *); + + /* config.h for applying patches and the configuration. */ + #include "config.h" +@@ -320,11 +321,7 @@ void + zoomreset(const Arg *arg) + { + Arg larg; +- +- if (defaultfontsize > 0) { +- larg.f = defaultfontsize; +- zoomabs(&larg); +- } ++ zoomabs(&larg); + } + + void +@@ -333,6 +330,17 @@ ttysend(const Arg *arg) + ttywrite(arg->s, strlen(arg->s), 1); + } + ++void ++cyclefonts(const Arg *arg) ++{ ++ currentfont++; ++ currentfont %= (sizeof fonts / sizeof fonts[0]); ++ usedfont = fonts[currentfont]; ++ Arg larg; ++ larg.f = usedfontsize; ++ zoomabs(&larg); ++} ++ + int + evcol(XEvent *e) + { +@@ -1152,7 +1160,7 @@ xinit(int cols, int rows) + if (!FcInit()) + die("could not init fontconfig.\n"); + +- usedfont = (opt_font == NULL)? font : opt_font; ++ usedfont = (opt_font == NULL)? fonts[currentfont] : opt_font; + xloadfonts(usedfont, 0); + + /* colors */ diff --git a/x11-terms/st/files/50_cozette-font.diff b/x11-terms/st/files/50_cozette-font.diff index 84b8bd5..2d1badb 100644 --- a/x11-terms/st/files/50_cozette-font.diff +++ b/x11-terms/st/files/50_cozette-font.diff @@ -1,13 +1,15 @@ diff --git i/config.def.h w/config.def.h -index b832a90..75c9bb0 100644 +index 7ca1274..9929c4a 100644 --- i/config.def.h +++ w/config.def.h -@@ -5,7 +5,7 @@ - * +@@ -6,8 +6,8 @@ * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html */ --static char *font = "Liberation Mono:pixelsize=12:antialias=true:autohint=true"; -+static char *font = "Cozette:size=20:antialias=false:autohint=false"; + static char *fonts[] = { +- "Liberation Mono:pixelsize=12:antialias=true:autohint=true", +- "Gohu GohuFont:pixelsize=11:antialias=false:autohint=false", ++ "Cozette:size=20:antialias=false:autohint=false", ++ "IBM Plex Mono:pixelsize=20:antialias=true:autohint=false", + }; + static size_t currentfont = 0; - /* disable bold, italic and roman fonts globally */ - int disablebold = 0; diff --git a/x11-terms/st/st-9999.ebuild b/x11-terms/st/st-9999.ebuild index 45769d3..d6b40cb 100644 --- a/x11-terms/st/st-9999.ebuild +++ b/x11-terms/st/st-9999.ebuild @@ -10,10 +10,11 @@ HOMEPAGE="https://st.suckless.org/" EGIT_REPO_URI="https://git.suckless.org/${PN}" PATCHES=( - "${FILESDIR}/01_disable-bold-italic-fonts-0.8.2.diff" - "${FILESDIR}/02_expected-anysize-0.9.diff" - "${FILESDIR}/50_cozette-font.diff" - "${FILESDIR}/51_colors.diff" + ${FILESDIR}/01_disable-bold-italic-fonts-0.8.2.diff + ${FILESDIR}/02_expected-anysize-0.9.diff + ${FILESDIR}/03_cyclefonts.diff + ${FILESDIR}/50_cozette-font.diff + ${FILESDIR}/51_colors.diff ) LICENSE="MIT" |