2019-04-02 19:13:41 +03:00
|
|
|
# based on Alex Kozadaev's st-disable-bold-italic-fonts.diff
|
|
|
|
# https://st.suckless.org/patches/disable_bold_italic_fonts/
|
|
|
|
|
|
|
|
diff --git a/config.def.h b/config.def.h
|
|
|
|
index 482901e..50a4896 100644
|
2018-12-03 17:23:00 +02:00
|
|
|
--- a/config.def.h
|
|
|
|
+++ b/config.def.h
|
2019-04-02 19:13:41 +03:00
|
|
|
@@ -6,6 +6,12 @@
|
|
|
|
* font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
|
|
|
|
*/
|
2018-12-03 17:23:00 +02:00
|
|
|
static char *font = "Liberation Mono:pixelsize=12:antialias=true:autohint=true";
|
2019-04-02 19:13:41 +03:00
|
|
|
+
|
|
|
|
+/* disable bold, italic and roman fonts globally */
|
2018-12-03 17:23:00 +02:00
|
|
|
+int disablebold = 0;
|
|
|
|
+int disableitalic = 0;
|
2019-04-02 19:13:41 +03:00
|
|
|
+int disableroman = 0;
|
2018-12-03 17:23:00 +02:00
|
|
|
+
|
2019-04-02 19:13:41 +03:00
|
|
|
static int borderpx = 2;
|
|
|
|
|
2018-12-03 17:23:00 +02:00
|
|
|
/*
|
2019-04-02 19:13:41 +03:00
|
|
|
diff --git a/x.c b/x.c
|
|
|
|
index 5828a3b..ad65501 100644
|
2018-12-03 17:23:00 +02:00
|
|
|
--- a/x.c
|
|
|
|
+++ b/x.c
|
2019-04-02 19:13:41 +03:00
|
|
|
@@ -244,6 +244,11 @@ static char *opt_title = NULL;
|
2018-12-03 17:23:00 +02:00
|
|
|
|
|
|
|
static int oldbutton = 3; /* button event on startup: 3 = release */
|
|
|
|
|
|
|
|
+/* declared in config.h */
|
|
|
|
+extern int disablebold;
|
|
|
|
+extern int disableitalic;
|
2019-04-02 19:13:41 +03:00
|
|
|
+extern int disableroman;
|
2018-12-03 17:23:00 +02:00
|
|
|
+
|
|
|
|
void
|
|
|
|
clipcopy(const Arg *dummy)
|
|
|
|
{
|
2019-04-02 19:13:41 +03:00
|
|
|
@@ -960,17 +965,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);
|
|
|
|
|