sites

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit c31ab08923d27dadf59d72f0699b31387b519884
parent 88918f46788b23c80062c48756369e8c0b6b1ce1
Author: Alex Kozadaev <snobb@gmx.com>
Date:   Tue, 28 Mar 2017 15:42:46 +0100

[st][disable bold/italic] add option to disable bold/italic fonts globally

Diffstat:
Ast.suckless.org/patches/disable_bold_italic_fonts.md | 17+++++++++++++++++
Ast.suckless.org/patches/st-disable-bold-italic-fonts.diff | 70++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 87 insertions(+), 0 deletions(-)

diff --git a/st.suckless.org/patches/disable_bold_italic_fonts.md b/st.suckless.org/patches/disable_bold_italic_fonts.md @@ -0,0 +1,17 @@ +Add an option to disable bold/italic fonts globally +================================================== + +Description +----------- + +Some terminals allow disabling bold/italic fonts globally. So this patch adds such option as well. + +Download +-------- + + * [st-disable-bold-italic-fonts.diff](st-disable-bold-italic-fonts.diff) + +Author +------ + + * Alex Kozadaev - <snobb@gmx at com> diff --git a/st.suckless.org/patches/st-disable-bold-italic-fonts.diff b/st.suckless.org/patches/st-disable-bold-italic-fonts.diff @@ -0,0 +1,70 @@ +From 1e932656e6ca3a50ec67cafabdb08d711635c504 Mon Sep 17 00:00:00 2001 +From: Alex Kozadaev <snobb@gmx.com> +Date: Fri, 24 Mar 2017 12:11:47 +0000 +Subject: [PATCH] disable bold, italic and roman fonts globally + +--- + config.def.h | 6 ++++++ + x.c | 14 +++++++++++--- + 2 files changed, 17 insertions(+), 3 deletions(-) + +diff --git a/config.def.h b/config.def.h +index 877afab..87c4534 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -6,6 +6,12 @@ + * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html + */ + 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; ++ + int borderpx = 2; + + /* +diff --git a/x.c b/x.c +index 743b084..23e4f0a 100644 +--- a/x.c ++++ b/x.c +@@ -158,6 +158,11 @@ typedef struct { + static Fontcache frc[16]; + static int frclen = 0; + ++/* declared in config.h */ ++extern int disablebold; ++extern int disableitalic; ++extern int disableroman; ++ + void + getbuttoninfo(XEvent *e) + { +@@ -828,17 +833,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("st: 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("st: 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("st: can't open font %s\n", fontstr); + +-- +2.1.4 +