changeset 28529:b8ac36c58391

(tty_suppress_bold_inverse_default_colors_p): New variable. (realize_tty_face): Suppress boldness if colors are the inverse of the default colors, and tty_suppress_bold_inverse_default_colors_p is set. (Ftty_suppress_bold_inverse_default_colors): New function. (syms_of_xfaces): Defsubr it.
author Gerd Moellmann <gerd@gnu.org>
date Sun, 09 Apr 2000 20:30:25 +0000
parents 7618c3801a21
children e17da1f43396
files src/xfaces.c
diffstat 1 files changed, 31 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/xfaces.c	Sun Apr 09 20:24:49 2000 +0000
+++ b/src/xfaces.c	Sun Apr 09 20:30:25 2000 +0000
@@ -410,6 +410,13 @@
 
 int face_change_count;
 
+/* Non-zero means don't display bold text if a face's foreground
+   and background colors are the inverse of the default colors of the
+   display.   This is a kluge to suppress `bold black' foreground text
+   which is hard to read on an LCD monitor.  */
+
+int tty_suppress_bold_inverse_default_colors_p;
+
 /* The total number of colors currently allocated.  */
 
 #if GLYPH_DEBUG
@@ -6154,10 +6161,33 @@
       face->background = tem;
     }
 
+  if (tty_suppress_bold_inverse_default_colors_p
+      && face->tty_bold_p
+      && face->background == FACE_TTY_DEFAULT_FG_COLOR
+      && face->foreground == FACE_TTY_DEFAULT_BG_COLOR)
+    face->tty_bold_p = 0;
+
   return face;
 }
 
 
+DEFUN ("tty-suppress-bold-inverse-default-colors",
+       Ftty_suppress_bold_inverse_default_colors,
+       Stty_suppress_bold_inverse_default_colors, 1, 1, 0,
+  "Suppress/allow boldness of faces with inverse default colors.\n\
+SUPPRESS non-nil means suppress it.\n\
+This affects bold faces whose foreground is the default background color\n\
+of the display and whose background is the default foreground color.\n\
+For such faces, no bold text will be displayed.")
+  (suppress)
+     Lisp_Object suppress;
+{
+  tty_suppress_bold_inverse_default_colors_p = !NILP (suppress);
+  ++face_change_count;
+  return suppress;
+}
+
+
 
 /***********************************************************************
 			   Computing Faces
@@ -6670,6 +6700,7 @@
   defsubr (&Sshow_face_resources);
 #endif /* GLYPH_DEBUG */
   defsubr (&Sclear_face_cache);
+  defsubr (&Stty_suppress_bold_inverse_default_colors);
 
   DEFVAR_LISP ("font-list-limit", &Vfont_list_limit,
     "*Limit for font matching.\n\