some patches and configuration for st terminal emulator
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

st-disable-bold-italic-fonts.patch 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. --- a/config.def.h
  2. +++ b/config.def.h
  3. @@ -8,6 +8,10 @@
  4. static char *font = "Liberation Mono:pixelsize=12:antialias=true:autohint=true";
  5. static int borderpx = 2;
  6. +/* disable bold and italic font styles */
  7. +int disablebold = 0;
  8. +int disableitalic = 0;
  9. +
  10. /*
  11. * What program is execed by st depends of these precedence rules:
  12. * 1: program passed with -e
  13. diff --git a/x.c b/x.c
  14. index 5828a3b..c433c58 100644
  15. --- a/x.c
  16. +++ b/x.c
  17. @@ -244,6 +244,10 @@ static char *opt_title = NULL;
  18. static int oldbutton = 3; /* button event on startup: 3 = release */
  19. +/* declared in config.h */
  20. +extern int disablebold;
  21. +extern int disableitalic;
  22. +
  23. void
  24. clipcopy(const Arg *dummy)
  25. {
  26. @@ -1177,13 +1181,15 @@ xmakeglyphfontspecs(XftGlyphFontSpec *specs, const Glyph *glyphs, int len, int x
  27. frcflags = FRC_NORMAL;
  28. runewidth = win.cw * ((mode & ATTR_WIDE) ? 2.0f : 1.0f);
  29. if ((mode & ATTR_ITALIC) && (mode & ATTR_BOLD)) {
  30. - font = &dc.ibfont;
  31. + if (!disableitalic && !disablebold) font = &dc.ibfont;
  32. + if (disableitalic && !disablebold) font = &dc.bfont;
  33. + if (!disableitalic && disablebold) font = &dc.ifont;
  34. frcflags = FRC_ITALICBOLD;
  35. } else if (mode & ATTR_ITALIC) {
  36. - font = &dc.ifont;
  37. + if (!disableitalic) font = &dc.ifont;
  38. frcflags = FRC_ITALIC;
  39. } else if (mode & ATTR_BOLD) {
  40. - font = &dc.bfont;
  41. + if (!disablebold) font = &dc.bfont;
  42. frcflags = FRC_BOLD;
  43. }
  44. yp = winy + font->ascent;