1477 |
(t |
(t |
1478 |
(> (tty-color-gray-shades display) 2))))) |
(> (tty-color-gray-shades display) 2))))) |
1479 |
|
|
1480 |
|
(defun display-supports-face-attributes-p (attributes &optional display) |
1481 |
|
"Return non-nil if all the face attributes in ATTRIBUTES are supported. |
1482 |
|
The optional argument DISPLAY can be a display name, a frame, or |
1483 |
|
nil (meaning the selected frame's display) |
1484 |
|
|
1485 |
|
The definition of `supported' is somewhat heuristic, but basically means |
1486 |
|
that a face containing all the attributes in ATTRIBUTES, when merged |
1487 |
|
with 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 |
|
|
1492 |
|
Point (2) implies that a `:weight black' attribute will be satisified by |
1493 |
|
any display that can display bold, and a `:foreground \"yellow\"' as long |
1494 |
|
as it can display a yellowish color, but `:slant italic' will _not_ be |
1495 |
|
satisified by the tty display code's automatic substitution of a `dim' |
1496 |
|
face 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 |
|
|
1504 |
|
|
1505 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1506 |
;;; Background mode. |
;;; Background mode. |