aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorMiles Bader2002-06-09 12:57:35 +0000
committerMiles Bader2002-06-09 12:57:35 +0000
commit6ae315b0d873be00a8d630aebd922b11244d40b8 (patch)
treed42f9160b4045a431b54bddb37b3d25ae876c355 /lisp
parent39ed191f8fc09625f20770799dc23c32da8163bc (diff)
downloademacs-6ae315b0d873be00a8d630aebd922b11244d40b8.tar.gz
emacs-6ae315b0d873be00a8d630aebd922b11244d40b8.zip
(display-supports-face-attributes-p): New function.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/faces.el24
1 files changed, 24 insertions, 0 deletions
diff --git a/lisp/faces.el b/lisp/faces.el
index ea391ae6149..83832f2b47f 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -1477,6 +1477,30 @@ If omitted or nil, that stands for the selected frame's display."
1477 (t 1477 (t
1478 (> (tty-color-gray-shades display) 2))))) 1478 (> (tty-color-gray-shades display) 2)))))
1479 1479
1480(defun display-supports-face-attributes-p (attributes &optional display)
1481 "Return non-nil if all the face attributes in ATTRIBUTES are supported.
1482The optional argument DISPLAY can be a display name, a frame, or
1483nil (meaning the selected frame's display)
1484
1485The definition of `supported' is somewhat heuristic, but basically means
1486that a face containing all the attributes in ATTRIBUTES, when merged
1487with the default face for display, can be represented in a way that's
1488
1489 (1) different in appearance than the default face, and
1490 (2) `close in spirit' to what the attributes specify, if not exact.
1491
1492Point (2) implies that a `:weight black' attribute will be satisified by
1493any display that can display bold, and a `:foreground \"yellow\"' as long
1494as it can display a yellowish color, but `:slant italic' will _not_ be
1495satisified by the tty display code's automatic substitution of a `dim'
1496face for italic."
1497 (let ((frame (car (frames-on-display-list display))))
1498 ;; For now, we assume that non-tty displays can support everything.
1499 ;; Later, we should add the ability to query about specific fonts,
1500 ;; colors, etc.
1501 (or (memq (framep frame) '(x w32 mac))
1502 (tty-supports-face-attributes-p attributes frame))))
1503
1480 1504
1481;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1505;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1482;;; Background mode. 1506;;; Background mode.