st

Custom st fork
git clone git://git.deurzen.net/st
Log | Files | Refs | README | LICENSE

commit 65ae0bb2ef75bfa8e047eb72e3950e0198c62b63
parent e3b02f631276e6ac6ddaf742f2aa5a2caf4005ca
Author: deurzen <m.deurzen@tum.de>
Date:   Thu, 14 Jan 2021 01:44:38 +0100

applies st-disable-font-styling-0.8.2.diff

Diffstat:
Mconfig.def.h | 5+++++
Aconfig.def.h.rej | 15+++++++++++++++
Mx.c | 14+++++++++++---
3 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/config.def.h b/config.def.h @@ -11,6 +11,11 @@ static char *fonts[] = { }; static int fonts_current = 0; +/* disable bold, italic and roman fonts globally */ +int disablebold = 1; +int disableitalic = 1; +int disableroman = 0; + static int borderpx = 2; /* diff --git a/config.def.h.rej b/config.def.h.rej @@ -0,0 +1,15 @@ +--- config.def.h ++++ config.def.h +@@ -6,6 +6,12 @@ + * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html + */ + static char *font = "xos4 Terminus:pixelsize=12"; ++ ++/* disable bold, italic and roman fonts globally */ ++int disablebold = 1; ++int disableitalic = 1; ++int disableroman = 0; ++ + static int borderpx = 2; + + /* diff --git a/x.c b/x.c @@ -244,6 +244,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; @@ -1015,17 +1020,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);