1

enter image description here

I'm using st terminal and I can't get rid of bold text, my curent font support bold and apply this patch doesn't help: https://st.suckless.org/patches/xresources/ with st.bold_font: 0 in .Xresources

Howto disable completely bold font with st?

Tuyen Pham
  • 1,765
  • 1
  • 16
  • 46
  • The patch doesn't attempt to do what you want. – Thomas Dickey Sep 28 '18 at 08:00
  • I tried other patches https://st.suckless.org/patches/solarized/st-no_bold_colors-0.8.1.diff and https://st.suckless.org/patches/disable_bold_italic_fonts/ separately, don't change the bold text either. – Tuyen Pham Sep 28 '18 at 08:22

1 Answers1

1

Patch

Unfortunately no one has made a patch for the current version (v0.8.1).

Fork

If you don't want to change the source code, then you can try the fork xst which has the ability to disable bold fonts, but also includes other patches.

Fontconfig

Another option (more of a workaround) is to disable bold monospaced (or specific) fonts everywhere by creating a config file for Fontconfig, for example in $HOME/.config/fontconfig/fonts.conf, or add to your existing, the following:

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
 <match target="pattern">
   <test qual="any" name="family">
     <string>monospace</string>
   </test>
   <test name="weight" compare="more">
     <const>medium</const>
   </test>
   <edit name="weight" mode="assign" binding="same">
     <const>medium</const>
   </edit>
 </match>
</fontconfig>

If you add to an existing file, make sure to remove the first three lines and the last line.

This assumes that you have compiled st with something like:

static char *font = "monospace:size=13:antialias=true:autohint=true";

In the config.h. Also that you have defined the font you use somewhere in your fontconfig something like this:

<alias>
  <family>monospace</family>
  <prefer>
    <family>Px437 IBM VGA8</family>
  </prefer>
</alias>
<alias>
  <family>Px437 IBM VGA8</family>
  <default>
    <family>monospace</family>
  </default>
</alias>

Then run the program fc-cache. Note that this will disable the Xresource colors color8 through color15 in st, but the patches might have done that as well.

Fontconfig can be a very difficult thing to configure, and it is very easy to make it do something that was not intended. Therefore, to cover this fully, is beyond the scope of this answer.

Klorax
  • 244
  • 1
  • 2
  • 10
  • Thanks, I don't mind to apply a patch to current version of st 0.8.1 but I don't like idea of xst that just includes multiple patches. Why don't just contribute via create / update patches to upstream `st`? – Tuyen Pham Sep 29 '18 at 06:40
  • Thanks again, I tried `xst` and this fork is more stable than `st` itself - I suffered X crash a lot when using browers with `st` and only with this fork `zsh substring` can be able to work properly on `xst-256color`, I'll use this fork. – Tuyen Pham Sep 29 '18 at 16:26
  • X crash even with `xst`, my bad. Chromium caused X crash under my wm. Have no idea what caused. – Tuyen Pham Sep 29 '18 at 18:03
  • I've just test with `st` and your fontconfig config, and it makes font worse, bold happens more often. I also tried to specify `80` but didn't work either. – Tuyen Pham Sep 29 '18 at 18:33
  • I use `PX437 IBM VGA8`, what would you suggest? I don't have good enough knowledge with font. – Tuyen Pham Sep 29 '18 at 19:10