]> code.delx.au - gnu-emacs/commitdiff
(tty_suppress_bold_inverse_default_colors_p): New
authorGerd Moellmann <gerd@gnu.org>
Sun, 9 Apr 2000 20:30:25 +0000 (20:30 +0000)
committerGerd Moellmann <gerd@gnu.org>
Sun, 9 Apr 2000 20:30:25 +0000 (20:30 +0000)
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.

src/xfaces.c

index 00697cdee29de42e5f4264c064d516c0bdfe115a..d775cc174c5609ca5f4f9ddbc095a646221a1479 100644 (file)
@@ -410,6 +410,13 @@ static int clear_font_table_count;
 
 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 @@ realize_tty_face (cache, attrs, c)
       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;
+}
+
+
 \f
 /***********************************************************************
                           Computing Faces
@@ -6670,6 +6700,7 @@ syms_of_xfaces ()
   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\