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

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. --- a/x.c
  14. +++ b/x.c
  15. @@ -240,6 +240,10 @@ static char *opt_title = NULL;
  16. static int oldbutton = 3; /* button event on startup: 3 = release */
  17. +/* declared in config.h */
  18. +extern int disablebold;
  19. +extern int disableitalic;
  20. +
  21. void
  22. clipcopy(const Arg *dummy)
  23. {
  24. @@ -1152,13 +1156,15 @@ xmakeglyphfontspecs(XftGlyphFontSpec *specs, const Glyph *glyphs, int len, int x
  25. frcflags = FRC_NORMAL;
  26. runewidth = win.cw * ((mode & ATTR_WIDE) ? 2.0f : 1.0f);
  27. if ((mode & ATTR_ITALIC) && (mode & ATTR_BOLD)) {
  28. - font = &dc.ibfont;
  29. + if (!disableitalic && !disablebold) font = &dc.ibfont;
  30. + if (disableitalic && !disablebold) font = &dc.bfont;
  31. + if (!disableitalic && disablebold) font = &dc.ifont;
  32. frcflags = FRC_ITALICBOLD;
  33. } else if (mode & ATTR_ITALIC) {
  34. - font = &dc.ifont;
  35. + if (!disableitalic) font = &dc.ifont;
  36. frcflags = FRC_ITALIC;
  37. } else if (mode & ATTR_BOLD) {
  38. - font = &dc.bfont;
  39. + if (!disablebold) font = &dc.bfont;
  40. frcflags = FRC_BOLD;
  41. }
  42. yp = winy + font->ascent;